Show More
@@ -158,9 +158,10 b' class Post(models.Model, Viewable):' | |||||
158 | url = self.url |
|
158 | url = self.url | |
159 |
|
159 | |||
160 | if url is None: |
|
160 | if url is None: | |
161 |
opening |
|
161 | opening = self.is_opening() | |
|
162 | opening_id = self.id if opening else thread.get_opening_post_id() | |||
162 | url = reverse('thread', kwargs={'post_id': opening_id}) |
|
163 | url = reverse('thread', kwargs={'post_id': opening_id}) | |
163 |
if |
|
164 | if not opening: | |
164 | url += '#' + str(self.id) |
|
165 | url += '#' + str(self.id) | |
165 |
|
166 | |||
166 | return url |
|
167 | return url | |
@@ -350,8 +351,7 b' class Post(models.Model, Viewable):' | |||||
350 |
|
351 | |||
351 | super().save(force_insert, force_update, using, update_fields) |
|
352 | super().save(force_insert, force_update, using, update_fields) | |
352 |
|
353 | |||
353 | # Post save triggers |
|
354 | if self.url is None: | |
354 | if new_post: |
|
|||
355 | self.build_url() |
|
355 | self.build_url() | |
356 |
|
356 | |||
357 | self._connect_replies() |
|
357 | self._connect_replies() |
@@ -100,7 +100,8 b' def cached_result(key_method=None):' | |||||
100 | result = persisted_result |
|
100 | result = persisted_result | |
101 | else: |
|
101 | else: | |
102 | result = function(obj, *args, **kwargs) |
|
102 | result = function(obj, *args, **kwargs) | |
103 | cache.set(cache_key, result) |
|
103 | if result is not None: | |
|
104 | cache.set(cache_key, result) | |||
104 |
|
105 | |||
105 | return result |
|
106 | return result | |
106 |
|
107 |
General Comments 0
You need to be logged in to leave comments.
Login now