Browse Source

Generate correct form token on attachments.

Rafał Pitoń 11 years ago
parent
commit
1b55d6d400
1 changed files with 4 additions and 1 deletions
  1. 4 1
      misago/apps/threadtype/posting/base.py

+ 4 - 1
misago/apps/threadtype/posting/base.py

@@ -108,7 +108,10 @@ class PostingBaseView(ViewBase):
         except AttributeError:
         except AttributeError:
             post_pk = 0
             post_pk = 0
 
 
-        self.attachments_token = 'attachments_%s_%s_%s_%s' % (self.request.user.pk, forum_pk, thread_pk, post_pk)
+        if post_pk:
+            self.attachments_token = 'attachments_0_%s_%s_%s' % (forum_pk, thread_pk, post_pk)
+        else:
+            self.attachments_token = 'attachments_%s_%s_%s_%s' % (self.request.user.pk, forum_pk, thread_pk, post_pk)
         self.attachments_removed_token = 'removed_%s' % self.attachments_token
         self.attachments_removed_token = 'removed_%s' % self.attachments_token
 
 
     def session_attachments_queryset(self):
     def session_attachments_queryset(self):