Changes the Services Add form for required input, also redirects user if they have no services to add.

This commit is contained in:
2010-03-15 14:28:50 +00:00
parent c17e4bae8f
commit d7fcc98153
2 changed files with 9 additions and 4 deletions

View File

@@ -34,8 +34,8 @@ def UserServiceAccountForm(user):
class ServiceAccountForm(forms.Form):
""" Service Account Form """
character = forms.ModelChoiceField(queryset=chars)
service = forms.ModelChoiceField(queryset=services)
character = forms.ModelChoiceField(queryset=chars, required=True, empty_label=None)
service = forms.ModelChoiceField(queryset=services, required=True, empty_label=None)
def clean(self):
if not self.cleaned_data['character'].corporation.group in self.cleaned_data['service'].groups.all():