-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix my activities filters * update --------- Co-authored-by: r350178982 <[email protected]>
- Loading branch information
1 parent
977aa79
commit 3a11ace
Showing
4 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -621,27 +621,31 @@ def _get_seafevents_session(): | |
session.close() | ||
|
||
|
||
def _get_activities(username, start, count): | ||
def _get_activities(username, start, count, op_user=None): | ||
ev_session = SeafEventsSession() | ||
|
||
events = [] | ||
try: | ||
events = seafevents_api.get_user_activities(ev_session, | ||
if op_user: | ||
events = seafevents_api.get_user_activities_by_op_user(ev_session, | ||
username, op_user, start, count) | ||
else: | ||
events = seafevents_api.get_user_activities(ev_session, | ||
username, start, count) | ||
finally: | ||
ev_session.close() | ||
|
||
return events | ||
|
||
|
||
def get_user_activities(username, start, count): | ||
def get_user_activities(username, start, count, op_user=None): | ||
"""Return user events list and a new start. | ||
For example: | ||
``get_user_activities('[email protected]', 0, 10)`` returns the first 10 | ||
``get_user_activities('[email protected]', 4, 10)`` returns the 6th through | ||
15th events. | ||
""" | ||
return _get_activities(username, start, count) | ||
return _get_activities(username, start, count, op_user) | ||
|
||
def get_user_activity_stats_by_day(start, end, offset): | ||
""" | ||
|