mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 14:32:16 +00:00
Big pile of minor code cleanups
This commit is contained in:
@@ -97,10 +97,10 @@ class EventForm(forms.ModelForm):
|
||||
raise forms.ValidationError(
|
||||
'You haven\'t provided any client contact details. Please add a person or organisation.',
|
||||
code='contact')
|
||||
return super(EventForm, self).clean()
|
||||
return super().clean()
|
||||
|
||||
def save(self, commit=True):
|
||||
m = super(EventForm, self).save(commit=False)
|
||||
m = super().save(commit=False)
|
||||
|
||||
if (commit):
|
||||
m.save()
|
||||
@@ -139,7 +139,7 @@ class BaseClientEventAuthorisationForm(forms.ModelForm):
|
||||
|
||||
class InternalClientEventAuthorisationForm(BaseClientEventAuthorisationForm):
|
||||
def __init__(self, **kwargs):
|
||||
super(InternalClientEventAuthorisationForm, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.fields['uni_id'].required = True
|
||||
self.fields['account_code'].required = True
|
||||
|
||||
@@ -154,7 +154,7 @@ class EventAuthorisationRequestForm(forms.Form):
|
||||
|
||||
class EventRiskAssessmentForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(EventRiskAssessmentForm, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
for name, field in self.fields.items():
|
||||
if str(name) == 'supervisor_consulted':
|
||||
field.widget = forms.CheckboxInput()
|
||||
@@ -185,7 +185,7 @@ class EventRiskAssessmentForm(forms.ModelForm):
|
||||
|
||||
class EventChecklistForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(EventChecklistForm, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields['date'].widget.format = '%Y-%m-%d'
|
||||
for name, field in self.fields.items():
|
||||
if field.__class__ == forms.NullBooleanField:
|
||||
|
||||
Reference in New Issue
Block a user