mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-16 21:12:13 +00:00
Merge branch 'master' of https://bitbucket.org/nottinghamtec/pyrigs
This commit is contained in:
@@ -10,9 +10,19 @@ from RIGS import models
|
||||
|
||||
#Registration
|
||||
class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
|
||||
first_name = forms.CharField(required=False, max_length=50)
|
||||
last_name = forms.CharField(required=False, max_length=50)
|
||||
initials = forms.CharField(required=True, max_length=5)
|
||||
phone = forms.CharField(required=False, max_length=13)
|
||||
|
||||
def clean_initials(self):
|
||||
"""
|
||||
Validate that the supplied initials are unique.
|
||||
"""
|
||||
if models.Profile.objects.filter(initials__iexact=self.cleaned_data['initials']):
|
||||
raise forms.ValidationError("These initials are already in use. Please supply different initials.")
|
||||
return self.cleaned_data['initials']
|
||||
|
||||
# Events Shit
|
||||
class EventForm(forms.ModelForm):
|
||||
datetime_input_formats = formats.get_format_lazy("DATETIME_INPUT_FORMATS") + settings.DATETIME_INPUT_FORMATS
|
||||
@@ -106,4 +116,4 @@ class EventForm(forms.ModelForm):
|
||||
fields = ['is_rig', 'name', 'venue', 'start_time', 'end_date', 'start_date',
|
||||
'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic',
|
||||
'person', 'organisation', 'dry_hire', 'checked_in_by', 'status',
|
||||
'collector',]
|
||||
'collector',]
|
||||
|
||||
Reference in New Issue
Block a user