Fixed missing form invalid error message.
This commit is contained in:
parent
511ee7298d
commit
72de1dce74
@ -176,6 +176,8 @@ def edit(request, application_id=None):
|
||||
return redirect(reverse('application_view', args=[application.id]))
|
||||
if application_id is None:
|
||||
return redirect(reverse('application_edit', args=[application.id]))
|
||||
else:
|
||||
messages.error(request, _('Please check the form for errors.'))
|
||||
else:
|
||||
if application_id is None:
|
||||
initial = {'text': config_get('application_preamble')}
|
||||
|
@ -114,6 +114,8 @@ def edit(request, assignment_id=None):
|
||||
return redirect(reverse("assignment_overview"))
|
||||
if assignment_id is None:
|
||||
return redirect(reverse('assignment_edit', args=[assignment.id]))
|
||||
else:
|
||||
messages.error(request, _('Please check the form for errors.'))
|
||||
else:
|
||||
form = AssignmentForm(instance=assignment)
|
||||
return {
|
||||
|
@ -109,7 +109,7 @@ def get_overview(request):
|
||||
@template('participant/edit.html')
|
||||
def edit(request, user_id=None):
|
||||
"""
|
||||
View zum editieren und neuanlegen von Usern mit Profile
|
||||
View to create and edit users with profile.
|
||||
"""
|
||||
if user_id is not None:
|
||||
user = User.objects.get(id=user_id)
|
||||
@ -124,7 +124,7 @@ def edit(request, user_id=None):
|
||||
userform = UserEditForm(request.POST, instance=user, prefix="user")
|
||||
profileform = ProfileForm(request.POST, instance=user.profile, prefix="profile")
|
||||
|
||||
if userform.is_valid and profileform.is_valid:
|
||||
if userform.is_valid() and profileform.is_valid():
|
||||
user = userform.save()
|
||||
if user_id is None:
|
||||
user.username = gen_username(user.first_name, user.last_name)
|
||||
|
Loading…
Reference in New Issue
Block a user