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'])
|
||||
|
||||
if member:
|
||||
member.student_id = request.POST['student_id']
|
||||
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 not member or len(errors) > 0:
|
||||
if not member:
|
||||
return render(request, 'ssmembership/import/review.html', {
|
||||
'member': member
|
||||
})
|
||||
|
||||
member.student_id = request.POST['student_id']
|
||||
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', {
|
||||
'member': member,
|
||||
'years': models.Member.YEARS,
|
||||
|
Loading…
Reference in New Issue
Block a user