Show More
@@ -56,8 +56,8 b' class User(models.Model):' | |||
|
56 | 56 | tags = self.fav_tags.annotate(Count('threads')) \ |
|
57 | 57 | .filter(threads__count__gt=0).order_by('name') |
|
58 | 58 | |
|
59 |
if tags |
|
|
60 |
cache.set(cache_key, tags |
|
|
59 | if tags: | |
|
60 | cache.set(cache_key, tags) | |
|
61 | 61 | |
|
62 | 62 | return tags |
|
63 | 63 | |
@@ -68,8 +68,12 b' class User(models.Model):' | |||
|
68 | 68 | return self.user_id + '(' + str(self.rank) + ')' |
|
69 | 69 | |
|
70 | 70 | def get_last_access_time(self): |
|
71 | """ | |
|
72 | Gets user's last post time. | |
|
73 | """ | |
|
74 | ||
|
71 | 75 | posts = Post.objects.filter(user=self) |
|
72 |
if posts. |
|
|
76 | if posts.exists() > 0: | |
|
73 | 77 | return posts.latest('pub_time').pub_time |
|
74 | 78 | |
|
75 | 79 | def add_tag(self, tag): |
General Comments 0
You need to be logged in to leave comments.
Login now