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):
4747 request .db .query (User )
4848 .outerjoin (Email )
4949 .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 ) ))
5151 .limit (request .registry .settings .get ("terms.notification_batch_size" ))
5252 )
5353 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):
212212 Show a detailed view of a Malware Report.
213213 """
214214 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+ )
216218
217219 return {"report" : observation }
218220
Original file line number Diff line number Diff line change @@ -1029,7 +1029,7 @@ def add_manual_activation(request):
10291029)
10301030def set_upload_limit (request ):
10311031 organization_id = request .matchdict ["organization_id" ]
1032- organization = request .db .query ( Organization ). get (organization_id )
1032+ organization = request .db .get (Organization , organization_id )
10331033 if organization is None :
10341034 raise HTTPNotFound
10351035
@@ -1215,7 +1215,7 @@ def delete_manual_activation(request):
12151215)
12161216def set_total_size_limit (request ):
12171217 organization_id = request .matchdict ["organization_id" ]
1218- organization = request .db .query ( Organization ). get (organization_id )
1218+ organization = request .db .get (Organization , organization_id )
12191219 if organization is None :
12201220 raise HTTPNotFound
12211221
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ def parse_attestations(
165165 f"attestation: { e } " ,
166166 )
167167 except Exception as e :
168- with sentry_sdk .push_scope () as scope :
168+ with sentry_sdk .new_scope () as scope :
169169 scope .fingerprint = [e ]
170170 sentry_sdk .capture_message (
171171 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):
3535 Project .lifecycle_status .is_distinct_from (
3636 LifecycleStatus .QuarantineEnter
3737 )
38- ).order_by (Project .normalized_name )
38+ )
39+ .order_by (Project .normalized_name )
40+ .scalar_subquery ()
3941 )
4042 )
4143 projects = request .db .execute (query ).scalar () or []
You can’t perform that action at this time.
0 commit comments