File tree 2 files changed +2
-6
lines changed
2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -183,14 +183,12 @@ def test_user_one_stats(self):
183
183
self .client .login (username = self .user .username , password = 'password' )
184
184
response = self .client .get (reverse ('changeset:user-stats' , args = ['4321' ]))
185
185
self .assertEqual (response .status_code , 200 )
186
- self .assertEqual (response .data .get ('changesets_in_osmcha' ), 3 )
187
186
self .assertEqual (response .data .get ('checked_changesets' ), 2 )
188
187
self .assertEqual (response .data .get ('harmful_changesets' ), 1 )
189
188
190
189
def test_user_without_changesets (self ):
191
190
self .client .login (username = self .user .username , password = 'password' )
192
191
response = self .client .get (reverse ('changeset:user-stats' , args = ['1611' ]))
193
192
self .assertEqual (response .status_code , 200 )
194
- self .assertEqual (response .data .get ('changesets_in_osmcha' ), 0 )
195
193
self .assertEqual (response .data .get ('checked_changesets' ), 0 )
196
194
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):
546
546
"""
547
547
query = """
548
548
SELECT
549
- count(*),
550
549
count(*) filter (where checked),
551
550
count(*) filter (where harmful)
552
551
FROM changeset_changeset
553
- WHERE uid = %s
552
+ WHERE uid = %s AND checked = TRUE
554
553
"""
555
554
with connection .cursor () as cursor :
556
555
cursor .execute (query , [str (uid )])
557
- total , checked , harmful = cursor .fetchone ()
556
+ checked , harmful = cursor .fetchone ()
558
557
instance = {
559
- "changesets_in_osmcha" : total ,
560
558
"checked_changesets" : checked ,
561
559
"harmful_changesets" : harmful
562
560
}
You can’t perform that action at this time.
0 commit comments