ci: merge pull request #6811 from ietf-tools/main

ci: merge main to release
This commit is contained in:
Robert Sparks 2023-12-18 16:51:24 -06:00 committed by GitHub
commit f770d7c2a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -210,11 +210,14 @@ def api_new_meeting_registration(request):
except (NomCom.DoesNotExist, NomCom.MultipleObjectsReturned):
nomcom = None
if nomcom:
Volunteer.objects.create(
Volunteer.objects.get_or_create(
nomcom=nomcom,
person=object.person,
affiliation=data['affiliation'],
origin='registration')
defaults={
"affiliation": data["affiliation"],
"origin": "registration"
}
)
return HttpResponse(response, status=202, content_type='text/plain')
else:
return HttpResponse(status=405)

View file

@ -1373,7 +1373,7 @@ def volunteer(request):
form = VolunteerForm(person=person, data=request.POST)
if form.is_valid():
for nc in form.cleaned_data['nomcoms']:
nc.volunteer_set.create(person=person, affiliation=form.cleaned_data['affiliation'])
nc.volunteer_set.get_or_create(person=person, defaults={"affiliation": form.cleaned_data["affiliation"], "origin":"datatracker"})
return redirect('ietf.ietfauth.views.profile')
else:
form = VolunteerForm(person=person,initial=dict(nomcoms=can_volunteer, affiliation=suggest_affiliation(person)))