File tree Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -183,14 +183,12 @@ def test_user_one_stats(self):
183183 self .client .login (username = self .user .username , password = 'password' )
184184 response = self .client .get (reverse ('changeset:user-stats' , args = ['4321' ]))
185185 self .assertEqual (response .status_code , 200 )
186- self .assertEqual (response .data .get ('changesets_in_osmcha' ), 3 )
187186 self .assertEqual (response .data .get ('checked_changesets' ), 2 )
188187 self .assertEqual (response .data .get ('harmful_changesets' ), 1 )
189188
190189 def test_user_without_changesets (self ):
191190 self .client .login (username = self .user .username , password = 'password' )
192191 response = self .client .get (reverse ('changeset:user-stats' , args = ['1611' ]))
193192 self .assertEqual (response .status_code , 200 )
194- self .assertEqual (response .data .get ('changesets_in_osmcha' ), 0 )
195193 self .assertEqual (response .data .get ('checked_changesets' ), 0 )
196194 self .assertEqual (response .data .get ('harmful_changesets' ), 0 )
Original file line number Diff line number Diff line change @@ -546,17 +546,15 @@ def user_stats(request, uid):
546546 """
547547 query = """
548548 SELECT
549- count(*),
550549 count(*) filter (where checked),
551550 count(*) filter (where harmful)
552551 FROM changeset_changeset
553- WHERE uid = %s
552+ WHERE uid = %s AND checked = TRUE
554553 """
555554 with connection .cursor () as cursor :
556555 cursor .execute (query , [str (uid )])
557556 total , checked , harmful = cursor .fetchone ()
558557 instance = {
559- "changesets_in_osmcha" : total ,
560558 "checked_changesets" : checked ,
561559 "harmful_changesets" : harmful
562560 }
You can’t perform that action at this time.
0 commit comments