You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/02/23 22:18:10 UTC

[GitHub] mistercrunch closed pull request #4475: Set limit of Recent Activity endpoint

mistercrunch closed pull request #4475: Set limit of Recent Activity endpoint
URL: https://github.com/apache/incubator-superset/pull/4475
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/views/core.py b/superset/views/core.py
index 87adb6e5eb..64b659d6b1 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1621,6 +1621,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(
@@ -1638,7 +1644,7 @@ def recent_activity(self, user_id):
                 ),
             )
             .order_by(M.Log.dttm.desc())
-            .limit(1000)
+            .limit(limit)
         )
         payload = []
         for log in qry.all():


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services