Skip to content

Commit

Permalink
Pass param of limit for recent activity (#4475)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh authored and mistercrunch committed Feb 23, 2018
1 parent 5830846 commit cacf53c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,12 @@ def testconn(self):
def recent_activity(self, user_id):
"""Recent activity (actions) for a given user"""
M = models # noqa

if request.args.get('limit'):
limit = int(request.args.get('limit'))
else:
limit = 1000

qry = (
db.session.query(M.Log, M.Dashboard, M.Slice)
.outerjoin(
Expand All @@ -1668,7 +1674,7 @@ def recent_activity(self, user_id):
),
)
.order_by(M.Log.dttm.desc())
.limit(1000)
.limit(limit)
)
payload = []
for log in qry.all():
Expand Down

0 comments on commit cacf53c

Please sign in to comment.