diff --git a/RIGS/finance.py b/RIGS/finance.py index e6423e13..9bb1b0b1 100644 --- a/RIGS/finance.py +++ b/RIGS/finance.py @@ -230,6 +230,7 @@ class PaymentCreate(generic.CreateView): class PaymentDelete(generic.DeleteView): model = models.Payment + template_name = 'payment_confirm_delete.html' def get_success_url(self): return self.request.POST.get('next') diff --git a/RIGS/forms.py b/RIGS/forms.py index 8913e64e..bb375c14 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -199,13 +199,13 @@ class EventChecklistForm(forms.ModelForm): self.items['v' + str(pk)] = item crewmembers = {key: val for key, val in self.data.items() - if key.startswith('crewmember')} - other_fields = ['start','role','end'] + if key.startswith('crewmember')} + other_fields = ['start', 'role', 'end'] for key in crewmembers: pk = int(key.split('_')[1]) for field in other_fields: - value = self.data['{}_{}'.format(field,pk)] + value = self.data['{}_{}'.format(field, pk)] if value == '': raise forms.ValidationError('Add a {} to crewmember {}'.format(field, pk), code='{}_mismatch'.format(field)) diff --git a/RIGS/migrations/0050_auto_20200830_1048.py b/RIGS/migrations/0050_auto_20200830_1048.py new file mode 100644 index 00000000..8d93bf95 --- /dev/null +++ b/RIGS/migrations/0050_auto_20200830_1048.py @@ -0,0 +1,43 @@ +# Generated by Django 3.1 on 2020-08-30 09:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('RIGS', '0049_auto_20200829_2313'), + ] + + operations = [ + migrations.AlterField( + model_name='eventchecklist', + name='fd_earth_fault', + field=models.IntegerField(help_text='Earth Fault Loop Impedance (ZS)', verbose_name='Earth Fault Loop Impedance'), + ), + migrations.AlterField( + model_name='eventchecklist', + name='fd_phase_rotation', + field=models.BooleanField(help_text='Phase Rotation
(if required)', verbose_name='Phase Rotation'), + ), + migrations.AlterField( + model_name='eventchecklist', + name='fd_pssc', + field=models.IntegerField(help_text='Prospective Short Circuit Current', verbose_name='PSCC'), + ), + migrations.AlterField( + model_name='eventchecklist', + name='fd_voltage_l1', + field=models.IntegerField(help_text='L1 - N', verbose_name='First Distro Voltage L1-N'), + ), + migrations.AlterField( + model_name='eventchecklist', + name='fd_voltage_l2', + field=models.IntegerField(help_text='L2 - N', verbose_name='First Distro Voltage L2-N'), + ), + migrations.AlterField( + model_name='eventchecklist', + name='fd_voltage_l3', + field=models.IntegerField(help_text='L3 - N', verbose_name='First Distro Voltage L3-N'), + ), + ] diff --git a/RIGS/models.py b/RIGS/models.py index 6ec83221..5055e1bf 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -666,12 +666,12 @@ class EventChecklist(models.Model, RevisionMixin): source_rcd = models.BooleanField(help_text="Source RCD protected?
(if cable is more than 3m long) ") labelling = models.BooleanField(help_text="Appropriate and clear labelling on distribution and cabling?") # First Distro - fd_voltage_l1 = models.IntegerField(help_text="L1 - N") - fd_voltage_l2 = models.IntegerField(help_text="L2 - N") - fd_voltage_l3 = models.IntegerField(help_text="L3 - N") - fd_phase_rotation = models.BooleanField(help_text="Phase Rotation
(if required)") - fd_earth_fault = models.IntegerField(help_text="Earth Fault Loop Impedance (ZS)") - fd_pssc = models.IntegerField(help_text="Prospective Short Circuit Current") + fd_voltage_l1 = models.IntegerField(verbose_name="First Distro Voltage L1-N", help_text="L1 - N") + fd_voltage_l2 = models.IntegerField(verbose_name="First Distro Voltage L2-N", help_text="L2 - N") + fd_voltage_l3 = models.IntegerField(verbose_name="First Distro Voltage L3-N", help_text="L3 - N") + fd_phase_rotation = models.BooleanField(verbose_name="Phase Rotation", help_text="Phase Rotation
(if required)") + fd_earth_fault = models.IntegerField(verbose_name="Earth Fault Loop Impedance", help_text="Earth Fault Loop Impedance (ZS)") + fd_pssc = models.IntegerField(verbose_name="PSCC", help_text="Prospective Short Circuit Current") all_rcds_tested = models.BooleanField(help_text="All circuit RCDs tested?(using test button)") public_sockets_tested = models.BooleanField(help_text="Public/Performer accessible circuits tested?(using socket tester)") diff --git a/RIGS/templates/event_checklist_form.html b/RIGS/templates/event_checklist_form.html index ef78e0b5..1684bba2 100644 --- a/RIGS/templates/event_checklist_form.html +++ b/RIGS/templates/event_checklist_form.html @@ -286,7 +286,7 @@ {% render_field form.fd_voltage_l1 class+="form-control" %} {% render_field form.fd_voltage_l2 class+="form-control" %} - {% render_field form.fd_voltage_l1 class+="form-control" %} + {% render_field form.fd_voltage_l3 class+="form-control" %} {{object|help_text:'fd_phase_rotation'|safe}} diff --git a/RIGS/templates/invoice_detail.html b/RIGS/templates/invoice_detail.html index 724427e5..9343bcbf 100644 --- a/RIGS/templates/invoice_detail.html +++ b/RIGS/templates/invoice_detail.html @@ -96,17 +96,12 @@
-
-
- {% with object.event as object %} - {% include 'item_table.html' %} - {% endwith %} -
+
+ {% with object.event as object %} + {% include 'item_table.html' %} + {% endwith %}
-
- {% include 'partials/last_edited.html' with target="invoice_history" %} -
{% endblock %} diff --git a/RIGS/templates/payment_form.html b/RIGS/templates/payment_form.html index 30f5d1b9..3efe74e4 100644 --- a/RIGS/templates/payment_form.html +++ b/RIGS/templates/payment_form.html @@ -4,48 +4,40 @@ {% block title %}Add Payment{% endblock %} {% block content %} -
-
-
- {% csrf_token %} - - -
- {% include 'form_errors.html' %} -
- -
- {% render_field form.date class+="form-control" %} -
-
- -
- -
-
-
- £ -
- {% render_field form.amount class+="form-control" %} -
-
-
-
- -
- {% render_field form.method class+="form-control" %} -
-
-
-
- -
-
-
-
+
+ {% csrf_token %} + + {% include 'form_errors.html' %} +
+ +
+ {% render_field form.date class+="form-control" %} +
-
+
+ +
+
+
+ £ +
+ {% render_field form.amount class+="form-control" %} +
+
+
+
+ +
+ {% render_field form.method class+="form-control" %} +
+
+
+
+ +
+
+ {% endblock %} diff --git a/RIGS/templatetags/filters.py b/RIGS/templatetags/filters.py index 2c0af443..5865fe2b 100644 --- a/RIGS/templatetags/filters.py +++ b/RIGS/templatetags/filters.py @@ -137,6 +137,7 @@ def profile_by_index(value): else: return "" + @register.filter def next(alist, current_index): """ @@ -144,6 +145,6 @@ def next(alist, current_index): Otherwise returns an empty string. """ try: - return alist[int(current_index) + 1] # access the next element - except: - return '' # return empty string in case of exception + return alist[int(current_index) + 1] # access the next element + except BaseException: + return '' # return empty string in case of exception diff --git a/templates/partials/search.html b/templates/partials/search.html index 4f735a81..9db7fa6d 100644 --- a/templates/partials/search.html +++ b/templates/partials/search.html @@ -4,7 +4,7 @@
- @@ -16,7 +16,7 @@
- + {% endif %} diff --git a/versioning/versioning.py b/versioning/versioning.py index aeacb594..3db76247 100644 --- a/versioning/versioning.py +++ b/versioning/versioning.py @@ -128,12 +128,12 @@ class ModelComparison(object): item_dict = {} # build a list of items, key is the item_pk # FIXME Removing the if checks makes things REALLY slow... for version in old_item_versions: # put all the old versions in a list - #if version.field_dict["event_id"] == int(self.new.pk): + # if version.field_dict["event_id"] == int(self.new.pk): compare = ModelComparison(old=version._object_version.object, **comparisonParams) item_dict[version.object_id] = compare for version in new_item_versions: # go through the new versions - #if version.field_dict["event_id"] == int(self.new.pk): + # if version.field_dict["event_id"] == int(self.new.pk): try: compare = item_dict[version.object_id] # see if there's a matching old version compare.new = version._object_version.object # then add the new version to the dictionary