File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -585,13 +585,17 @@ class _NewInstitutionUserMetricsList(InstitutionMixin, ElasticsearchListView):
585585 ))
586586
587587 def get_default_search (self ):
588- _yearmonth = InstitutionalUserReport .most_recent_yearmonth ()
589- if _yearmonth is None :
588+ base_search = InstitutionalUserReport .search ().filter (
589+ 'term' ,
590+ institution_id = self .get_institution ()._id ,
591+ )
592+ yearmonth = InstitutionalUserReport .most_recent_yearmonth (base_search = base_search )
593+ if yearmonth is None :
590594 return None
595+
591596 return (
592- InstitutionalUserReport .search ()
593- .filter ('term' , report_yearmonth = str (_yearmonth ))
594- .filter ('term' , institution_id = self .get_institution ()._id )
597+ base_search
598+ .filter ('term' , report_yearmonth = str (yearmonth ))
595599 .exclude ('term' , user_name = 'Deleted user' )
596600 )
597601
You can’t perform that action at this time.
0 commit comments