Skip to content

Commit

Permalink
Limit user events to 5 in profile view
Browse files Browse the repository at this point in the history
  • Loading branch information
phlax committed May 22, 2017
1 parent 4741ef2 commit 4895b3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pootle/apps/pootle_profile/templatetags/profile_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def profile_activity(profile, request_lang=None):
context = dict(profile=profile)
if profile.user.is_meta:
return context
context["user_events"] = context["profile"].get_events()
context["user_events"] = context["profile"].get_events(n=5)
context["user_last_event"] = (
context["profile"].user.last_event(locale=request_lang))
return context
2 changes: 1 addition & 1 deletion pootle/apps/pootle_profile/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_events(self, start=None, n=None):
else:
_events.append(formatters.get("group")(self.user, evs))
if n is not None:
events = events[-n:]
_events = _events[-n:]
return reversed(_events)


Expand Down

0 comments on commit 4895b3d

Please sign in to comment.