Browse Source

fix leaks on thread and category list

Rafał Pitoń 8 years ago
parent
commit
74662221b4
2 changed files with 6 additions and 9 deletions
  1. 0 3
      misago/threads/permissions/threads.py
  2. 6 6
      misago/threads/threadtypes/thread.py

+ 0 - 3
misago/threads/permissions/threads.py

@@ -709,9 +709,6 @@ def can_change_owned_thread(user, target):
     if target.category.is_closed or target.is_closed:
     if target.category.is_closed or target.is_closed:
         return False
         return False
 
 
-    if target.first_post.is_protected:
-        return False
-
     return has_time_to_edit_thread(user, target)
     return has_time_to_edit_thread(user, target)
 
 
 
 

+ 6 - 6
misago/threads/threadtypes/thread.py

@@ -24,15 +24,15 @@ class Thread(ThreadType):
 
 
     def get_category_last_thread_url(self, category):
     def get_category_last_thread_url(self, category):
         return reverse('misago:thread', kwargs={
         return reverse('misago:thread', kwargs={
-            'slug': category.last_thread.slug,
-            'pk': category.last_thread.pk
+            'slug': category.last_thread_slug,
+            'pk': category.last_thread_id
         })
         })
 
 
     def get_category_last_post_url(self, category):
     def get_category_last_post_url(self, category):
-        return '/threads/%s-%s/last/' % (
-            category.last_thread_slug,
-            category.last_thread_id
-        )
+        return reverse('misago:thread-last', kwargs={
+            'slug': category.last_thread_slug,
+            'pk': category.last_thread_id
+        })
 
 
     def get_category_api_read_url(self, category):
     def get_category_api_read_url(self, category):
         if category.level:
         if category.level: