mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Build(deps): Generally update JS & Python deps (#512)
This commit is contained in:
@@ -217,7 +217,7 @@ class EventChecklistForm(forms.ModelForm):
|
||||
for key in vehicles:
|
||||
pk = int(key.split('_')[1])
|
||||
driver_key = 'driver_' + str(pk)
|
||||
if(self.data[driver_key] == ''):
|
||||
if (self.data[driver_key] == ''):
|
||||
raise forms.ValidationError('Add a driver to vehicle ' + str(pk), code='vehicle_mismatch')
|
||||
else:
|
||||
try:
|
||||
|
||||
@@ -118,9 +118,9 @@ def orderby(request, field, attr):
|
||||
@register.filter(needs_autoescape=True) # Used for accessing outside of a form, i.e. in detail views of RiskAssessment and EventChecklist
|
||||
def get_field(obj, field, autoescape=True):
|
||||
value = getattr(obj, field)
|
||||
if(isinstance(value, bool)):
|
||||
if (isinstance(value, bool)):
|
||||
value = yesnoi(value, field in obj.inverted_fields)
|
||||
elif(isinstance(value, str)):
|
||||
elif (isinstance(value, str)):
|
||||
value = truncatewords(value, 20)
|
||||
return mark_safe(value)
|
||||
|
||||
@@ -144,7 +144,7 @@ def get_list(dictionary, key):
|
||||
|
||||
@register.filter
|
||||
def profile_by_index(value):
|
||||
if(value):
|
||||
if (value):
|
||||
return models.Profile.objects.get(pk=int(value))
|
||||
else:
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user