diff --git a/openslides/application/forms.py b/openslides/application/forms.py index 2d4bf5518..9da1f3a83 100644 --- a/openslides/application/forms.py +++ b/openslides/application/forms.py @@ -15,6 +15,7 @@ from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.utils.forms import CssClassMixin +from openslides.utils.user import UserFormField from openslides.application.models import Application @@ -50,11 +51,7 @@ class ApplicationFormTrivialChanges(ApplicationForm): class ApplicationManagerForm(forms.ModelForm, CssClassMixin): - submitter = UserModelChoiceField( - queryset=User.objects.all().exclude(profile=None). - order_by("first_name"), - label=_("Submitter"), - ) + submitter = UserFormField() class Meta: model = Application diff --git a/openslides/application/models.py b/openslides/application/models.py index c06b4716e..e0d8b738b 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -21,6 +21,7 @@ from django.utils.translation import pgettext from django.utils.translation import ugettext_lazy as _, ugettext_noop, ugettext from openslides.utils.utils import _propper_unicode +from openslides.utils.user import UserField from openslides.config.models import config from openslides.config.signals import default_config_value @@ -60,7 +61,7 @@ class Application(models.Model, SlideMixin): # genpoll ) - submitter = models.ForeignKey(User, verbose_name=_("Submitter")) + submitter = UserField(verbose_name=_("Submitter")) supporter = models.ManyToManyField(User, related_name='supporter', \ null=True, blank=True, verbose_name=_("Supporters")) number = models.PositiveSmallIntegerField(blank=True, null=True, diff --git a/openslides/application/templates/application/view.html b/openslides/application/templates/application/view.html index 0ae213ab0..dd9ad9c69 100644 --- a/openslides/application/templates/application/view.html +++ b/openslides/application/templates/application/view.html @@ -16,8 +16,8 @@