Skip to content

Commit

Permalink
remove double if and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
elichad committed Nov 22, 2023
1 parent 64b3a28 commit ae33486
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions amy/extrequests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,13 @@ def all_trainingrequests(request):
for r in training_requests:
# find which membership to use
# if membership can't be determined, skip this request
if membership_auto_assign:
try:
membership_to_use = (
get_membership_from_training_request_or_raise_error(r)
)
except (ValueError, Membership.DoesNotExist) as e:
errors.append(str(e))
continue
try:
membership_to_use = (
get_membership_from_training_request_or_raise_error(r)
)
except (ValueError, Membership.DoesNotExist) as e:
errors.append(str(e))
continue

# perform match
accept_training_request_and_match_to_event(
Expand Down Expand Up @@ -627,6 +626,7 @@ def all_trainingrequests(request):
membership=membership, seat_public=seat_public, event=event
)

# Matching is complete, display messages
for msg in warnings:
messages.warning(request, msg)
for msg in errors:
Expand Down

0 comments on commit ae33486

Please sign in to comment.