superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Pass param of limit for recent activity (#4475)
Date Fri, 23 Feb 2018 22:18:09 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new cacf53c  Pass param of limit for recent activity (#4475)
cacf53c is described below

commit cacf53c92ee6aecc642170ff0ab4bf58b4b348ae
Author: Hugh A. Miles II <hughmil3s@gmail.com>
AuthorDate: Fri Feb 23 14:18:06 2018 -0800

    Pass param of limit for recent activity (#4475)
---
 superset/views/core.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index e5a6bf0..b51f0cd 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1651,6 +1651,12 @@ class Superset(BaseSupersetView):
     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(
@@ -1668,7 +1674,7 @@ class Superset(BaseSupersetView):
                 ),
             )
             .order_by(M.Log.dttm.desc())
-            .limit(1000)
+            .limit(limit)
         )
         payload = []
         for log in qry.all():

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message