-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: don't create a volunteer object when a person has already volunt… #6809
Conversation
ietf/api/views.py
Outdated
@@ -209,7 +209,7 @@ def err(code, text): | |||
nomcom = NomCom.objects.get(is_accepting_volunteers=True) | |||
except (NomCom.DoesNotExist, NomCom.MultipleObjectsReturned): | |||
nomcom = None | |||
if nomcom: | |||
if nomcom and not Volunteer.objects.filter(nomcom=nomcom,person=object.person).exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Volunteer.objects.get_or_create()
instead?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6809 +/- ##
=======================================
Coverage 88.78% 88.79%
=======================================
Files 285 285
Lines 40324 40324
=======================================
+ Hits 35802 35804 +2
+ Misses 4522 4520 -2 ☔ View full report in Codecov by Sentry. |
No description provided.