Commits

Diego Búrigo Zacarão  committed 1e6b8a5

Fixed user Timeline querying (#485)

  • Participants
  • Parent commits 98bdba9

Comments (0)

Files changed (2)

File transifex/actionlog/models.py

         ctype = ContentType.objects.get_for_model(obj)
         return self.filter(content_type__pk=ctype.pk, object_id=obj.pk)
 
+    def by_user(self, user):
+        """Return LogEntries for a specific user."""
+        return self.filter(user__pk__exact=user.pk)
+
     def by_object_last_week(self, obj):
         """Return LogEntries of the related object for the last week."""
         last_week_date = datetime.datetime.today() - datetime.timedelta(days=7)

File transifex/txcommon/views.py

     The view limits the results and uses filters to allow the user to even
     further refine the set.
     """
-    log_entries = LogEntry.objects.for_projects_by_user(request.user)
+    log_entries = LogEntry.objects.by_user(request.user)
     f = LogEntryFilter(request.GET, queryset=log_entries)
 
     return render_to_response("txcommon/user_timeline.html",