mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +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
|
#Registration
|
||||||
class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
|
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)
|
initials = forms.CharField(required=True, max_length=5)
|
||||||
phone = forms.CharField(required=False, max_length=13)
|
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
|
# Events Shit
|
||||||
class EventForm(forms.ModelForm):
|
class EventForm(forms.ModelForm):
|
||||||
datetime_input_formats = formats.get_format_lazy("DATETIME_INPUT_FORMATS") + settings.DATETIME_INPUT_FORMATS
|
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',
|
fields = ['is_rig', 'name', 'venue', 'start_time', 'end_date', 'start_date',
|
||||||
'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic',
|
'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic',
|
||||||
'person', 'organisation', 'dry_hire', 'checked_in_by', 'status',
|
'person', 'organisation', 'dry_hire', 'checked_in_by', 'status',
|
||||||
'collector',]
|
'collector',]
|
||||||
|
|||||||
Reference in New Issue
Block a user