Merged.
This commit is contained in:
commit
8ef0b0ad81
@ -41,7 +41,7 @@ PDF:
|
||||
- [Bugfix] Print available candidates in assignment pdf (#14)
|
||||
- [Bugfix] "Show ""undocumented"" for result ""-2"" in application and assignment pdf" (#17)
|
||||
Other:
|
||||
- [Feature] Rights for anonymous rene enhancement (#45)
|
||||
- [Feature] Rights for anonymous (#45)
|
||||
- [Feature] Show counter for limited speaking time (#52)
|
||||
- [Feature] Reorderd config tab subpages (#61)
|
||||
- [Localize] i18n German: Use gender-specific strings (#51)
|
||||
|
@ -177,6 +177,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 {
|
||||
|
@ -19,7 +19,6 @@ from participant.api import gen_password
|
||||
|
||||
class Profile(models.Model):
|
||||
GENDER_CHOICES = (
|
||||
('none', _('Not specified')),
|
||||
('male', _('Male')),
|
||||
('female', _('Female')),
|
||||
)
|
||||
@ -31,9 +30,9 @@ class Profile(models.Model):
|
||||
)
|
||||
|
||||
user = models.OneToOneField(User, unique=True, editable=False)
|
||||
gender = models.CharField(max_length=50, choices=GENDER_CHOICES, default='none', verbose_name = _("Gender"))
|
||||
gender = models.CharField(max_length=50, choices=GENDER_CHOICES, blank=True, verbose_name = _("Gender"))
|
||||
group = models.CharField(max_length=100, null=True, blank=True, verbose_name = _("Group"))
|
||||
type = models.CharField(max_length=100, choices=TYPE_CHOICE, default='guest', verbose_name = _("Typ"))
|
||||
type = models.CharField(max_length=100, choices=TYPE_CHOICE, blank=True, verbose_name = _("Typ"))
|
||||
committee = models.CharField(max_length=100, null=True, blank=True, verbose_name = _("Committee"))
|
||||
firstpassword = models.CharField(max_length=100, null=True, blank=True, verbose_name = _("First Password"))
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<option value="---">-- {%trans "Gender" %}--</option>
|
||||
<option value="male" {% if 'male' in sortfilter.gender %}selected{% endif %}>{%trans "Male" %}</option>
|
||||
<option value="female" {% if 'female' in sortfilter.gender %}selected{% endif %}>{%trans "Female" %}</option>
|
||||
<option value="none" {% if 'none' in sortfilter.gender %}selected{% endif %}>{%trans "Not specified" %}</option>
|
||||
<option value="" {% if '' in sortfilter.gender %}selected{% endif %}>{%trans "Not specified" %}</option>
|
||||
</select>
|
||||
<select class="default-input" name="group" onchange="document.forms['filter'].submit()">
|
||||
<option value="---">-- {%trans "Group" %}--</option>
|
||||
@ -26,6 +26,7 @@
|
||||
<option value="observer" {% if 'observer' in sortfilter.type %}selected{% endif %}>{%trans "Observer" %}</option>
|
||||
<option value="staff" {% if 'staff' in sortfilter.type %}selected{% endif %}>{%trans "Staff" %}</option>
|
||||
<option value="guest" {% if 'guest' in sortfilter.type %}selected{% endif %}>{%trans "Guest" %}</option>
|
||||
<option value="" {% if '' in sortfilter.type %}selected{% endif %}>{%trans "Not specified" %}</option>
|
||||
</select>
|
||||
<select class="default-input" name="committee" onchange="document.forms['filter'].submit()">
|
||||
<option value="---">-- {%trans "Committee" %}--</option>
|
||||
|
@ -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