Fix bug in import save when non-existent member
This commit is contained in:
parent
c8841f10b6
commit
168a8c17bc
@ -121,17 +121,22 @@ def import_save(request):
|
|||||||
|
|
||||||
member = mimport.by_email(request.POST['email_orig'])
|
member = mimport.by_email(request.POST['email_orig'])
|
||||||
|
|
||||||
if member:
|
if not member:
|
||||||
member.student_id = request.POST['student_id']
|
return render(request, 'ssmembership/import/review.html', {
|
||||||
member.email = request.POST['email']
|
'member': member
|
||||||
member.first_name = request.POST['first_name']
|
})
|
||||||
member.last_name = request.POST['last_name']
|
|
||||||
member.phone = request.POST['phone']
|
|
||||||
member.year = int(request.POST['year'])
|
|
||||||
member.is_msa = True if request.POST['is_msa'] == '1' else '0'
|
|
||||||
|
|
||||||
errors = member.validation_problems()
|
member.student_id = request.POST['student_id']
|
||||||
if not member or len(errors) > 0:
|
member.email = request.POST['email']
|
||||||
|
member.first_name = request.POST['first_name']
|
||||||
|
member.last_name = request.POST['last_name']
|
||||||
|
member.phone = request.POST['phone']
|
||||||
|
member.year = int(request.POST['year'])
|
||||||
|
member.is_msa = True if request.POST['is_msa'] == '1' else '0'
|
||||||
|
|
||||||
|
errors = member.validation_problems()
|
||||||
|
|
||||||
|
if len(errors) > 0:
|
||||||
return render(request, 'ssmembership/import/review.html', {
|
return render(request, 'ssmembership/import/review.html', {
|
||||||
'member': member,
|
'member': member,
|
||||||
'years': models.Member.YEARS,
|
'years': models.Member.YEARS,
|
||||||
|
Loading…
Reference in New Issue
Block a user