File tree Expand file tree Collapse file tree 5 files changed +10
-6
lines changed Expand file tree Collapse file tree 5 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def notify_users_of_tos_update(request):
47
47
request .db .query (User )
48
48
.outerjoin (Email )
49
49
.filter (Email .verified == True , Email .primary == True ) # noqa E711
50
- .filter (User .id .not_in (already_notified_subquery ))
50
+ .filter (User .id .not_in (select ( already_notified_subquery ) ))
51
51
.limit (request .registry .settings .get ("terms.notification_batch_size" ))
52
52
)
53
53
for user in users_to_notify :
Original file line number Diff line number Diff line change @@ -212,7 +212,9 @@ def malware_reports_detail(request):
212
212
Show a detailed view of a Malware Report.
213
213
"""
214
214
observation_id = request .matchdict .get ("observation_id" )
215
- observation = request .db .get (Observation , observation_id )
215
+ observation = (
216
+ request .db .get (Observation , observation_id ) if observation_id else None
217
+ )
216
218
217
219
return {"report" : observation }
218
220
Original file line number Diff line number Diff line change @@ -1029,7 +1029,7 @@ def add_manual_activation(request):
1029
1029
)
1030
1030
def set_upload_limit (request ):
1031
1031
organization_id = request .matchdict ["organization_id" ]
1032
- organization = request .db .query ( Organization ). get (organization_id )
1032
+ organization = request .db .get (Organization , organization_id )
1033
1033
if organization is None :
1034
1034
raise HTTPNotFound
1035
1035
@@ -1215,7 +1215,7 @@ def delete_manual_activation(request):
1215
1215
)
1216
1216
def set_total_size_limit (request ):
1217
1217
organization_id = request .matchdict ["organization_id" ]
1218
- organization = request .db .query ( Organization ). get (organization_id )
1218
+ organization = request .db .get (Organization , organization_id )
1219
1219
if organization is None :
1220
1220
raise HTTPNotFound
1221
1221
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ def parse_attestations(
165
165
f"attestation: { e } " ,
166
166
)
167
167
except Exception as e :
168
- with sentry_sdk .push_scope () as scope :
168
+ with sentry_sdk .new_scope () as scope :
169
169
scope .fingerprint = [e ]
170
170
sentry_sdk .capture_message (
171
171
f"Unexpected error while verifying attestation: { e } "
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ def _simple_index(request, serial):
35
35
Project .lifecycle_status .is_distinct_from (
36
36
LifecycleStatus .QuarantineEnter
37
37
)
38
- ).order_by (Project .normalized_name )
38
+ )
39
+ .order_by (Project .normalized_name )
40
+ .scalar_subquery ()
39
41
)
40
42
)
41
43
projects = request .db .execute (query ).scalar () or []
You can’t perform that action at this time.
0 commit comments