From e0615f318c64a3c4d3d2b77eff7daeab2c06cb93 Mon Sep 17 00:00:00 2001 From: Arona Jones Date: Mon, 16 Nov 2020 18:26:28 +0000 Subject: [PATCH] Implement some of Jonny's suggested changes TODO: - Define event size at RA time, pass through to EC - Have later power questions be context dependent --- RIGS/migrations/0045_auto_20201116_1808.py | 34 ++++++++++++++++++++++ RIGS/models.py | 10 ++++--- RIGS/templates/partials/ec_power_info.html | 2 +- RIGS/templates/risk_assessment_detail.html | 18 +++++++----- RIGS/templates/risk_assessment_form.html | 7 +++-- RIGS/tests/pages.py | 2 +- users/templates/profile_detail.html | 2 +- 7 files changed, 58 insertions(+), 17 deletions(-) create mode 100644 RIGS/migrations/0045_auto_20201116_1808.py diff --git a/RIGS/migrations/0045_auto_20201116_1808.py b/RIGS/migrations/0045_auto_20201116_1808.py new file mode 100644 index 00000000..52d243e1 --- /dev/null +++ b/RIGS/migrations/0045_auto_20201116_1808.py @@ -0,0 +1,34 @@ +# Generated by Django 3.1.2 on 2020-11-16 18:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('RIGS', '0044_auto_20201024_2031'), + ] + + operations = [ + migrations.AddField( + model_name='riskassessment', + name='outside', + field=models.BooleanField(default=False, help_text='Is the event outdoors?'), + preserve_default=False, + ), + migrations.AlterField( + model_name='riskassessment', + name='contractors', + field=models.BooleanField(help_text='Are you using any external contractors?i.e. Freelancers/Crewing Companies'), + ), + migrations.AlterField( + model_name='riskassessment', + name='nonstandard_equipment', + field=models.BooleanField(help_text="Does the event require any hired in equipment or use of equipment that is not covered by TEC's standard risk assessments and method statements?"), + ), + migrations.AlterField( + model_name='riskassessment', + name='other_companies', + field=models.BooleanField(help_text='Are TEC working with any other companies on site?e.g. TEC is providing the lighting while another company does sound'), + ), + ] diff --git a/RIGS/models.py b/RIGS/models.py index c5d61d02..26ae9ea6 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -614,15 +614,17 @@ class Payment(models.Model, RevisionMixin): class RiskAssessment(models.Model, RevisionMixin): event = models.OneToOneField('Event', on_delete=models.CASCADE) # General - nonstandard_equipment = models.BooleanField(help_text="Does the event require any hired in equipment or use of equipment that is not covered by TEC's standard risk assessments and method statements?") + nonstandard_equipment = models.BooleanField(help_text="Does the event require any hired in equipment or use of equipment that is not covered by TEC's standard risk assessments and method statements?") nonstandard_use = models.BooleanField(help_text="Are TEC using their equipment in a way that is abnormal?
i.e. Not covered by TECs standard health and safety documentation") - contractors = models.BooleanField(help_text="Are you using any external contractors?") - other_companies = models.BooleanField(help_text="Are TEC working with any other companies on site?") + contractors = models.BooleanField(help_text="Are you using any external contractors?i.e. Freelancers/Crewing Companies") + other_companies = models.BooleanField(help_text="Are TEC working with any other companies on site?e.g. TEC is providing the lighting while another company does sound") crew_fatigue = models.BooleanField(help_text="Is crew fatigue likely to be a risk at any point during this event?") general_notes = models.TextField(blank=True, null=True, help_text="Did you have to consult a supervisor about any of the above? If so who did you consult and what was the outcome?") # Power big_power = models.BooleanField(help_text="Does the event require larger power supplies than 13A or 16A single phase wall sockets, or draw more than 20A total current?") + outside = models.BooleanField(help_text="Is the event outdoors?") + # If yes to the above two, you must answer... power_mic = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='power_mic', blank=True, null=True, verbose_name="Power MIC", on_delete=models.CASCADE, help_text="Who is the Power MIC?") generators = models.BooleanField(help_text="Will generators be used?") @@ -645,8 +647,8 @@ class RiskAssessment(models.Model, RevisionMixin): # Structures special_structures = models.BooleanField(help_text="Does the event require use of winch stands, motors, MPT Towers, or staging?") - persons_responsible_structures = models.TextField(blank=True, null=True, help_text="Who are the persons on site responsible for their use?") suspended_structures = models.BooleanField(help_text="Are any structures (excluding projector screens and IWBs) being suspended from TEC's structures?") + persons_responsible_structures = models.TextField(blank=True, null=True, help_text="Who are the persons on site responsible for their use?") # Blimey that was a lot of options diff --git a/RIGS/templates/partials/ec_power_info.html b/RIGS/templates/partials/ec_power_info.html index 1c57734a..aaf4543d 100644 --- a/RIGS/templates/partials/ec_power_info.html +++ b/RIGS/templates/partials/ec_power_info.html @@ -1,4 +1,4 @@ -
+
diff --git a/RIGS/templates/risk_assessment_detail.html b/RIGS/templates/risk_assessment_detail.html index c622e7d3..a6d05b3f 100644 --- a/RIGS/templates/risk_assessment_detail.html +++ b/RIGS/templates/risk_assessment_detail.html @@ -51,6 +51,10 @@ {{ object.power_mic.name|default:'None' }}
{{ object|help_text:'generators' }}
+
+ {{ object.outside|yesnoi:'invert' }} +
+
{{ object|help_text:'outside' }}
{{ object.generators|yesnoi:'invert' }}
@@ -94,15 +98,15 @@
{{ object|help_text:'known_venue' }}
- {{ object.known_venue|yesnoi }} + {{ object.known_venue|yesnoi:'invert' }}
{{ object|help_text:'safe_loading'|safe }}
- {{ object.safe_loading|yesnoi }} + {{ object.safe_loading|yesnoi:'invert' }}
{{ object|help_text:'safe_storage' }}
- {{ object.safe_storage|yesnoi }} + {{ object.safe_storage|yesnoi:'invert' }}
{{ object|help_text:'area_outside_of_control' }}
@@ -127,14 +131,14 @@
{{ object.special_structures|yesnoi:'invert' }}
-
{{ object|help_text:'persons_responsible_structures' }}
-
- {{ object.persons_responsible_structures.name|default:'N/A'|linebreaks }} -
{{ object|help_text:'suspended_structures' }}
{{ object.suspended_structures|yesnoi:'invert' }}
+
{{ object|help_text:'persons_responsible_structures' }}
+
+ {{ object.persons_responsible_structures.name|default:'N/A'|linebreaks }} +
diff --git a/RIGS/templates/risk_assessment_form.html b/RIGS/templates/risk_assessment_form.html index 6d8301be..c57eca13 100644 --- a/RIGS/templates/risk_assessment_form.html +++ b/RIGS/templates/risk_assessment_form.html @@ -83,6 +83,7 @@
Power
{% include 'partials/yes_no_radio.html' with formitem=form.big_power %} + {% include 'partials/yes_no_radio.html' with formitem=form.outside %}
@@ -108,7 +109,7 @@
Sound
-

If yes, consult a supervisor of sound and make sure an appropriate noise monitoring plan and risk assessment is drawn up

+

If yes, consult a supervisor of sound

{% include 'partials/yes_no_radio.html' with formitem=form.noise_monitoring %} {% render_field form.sound_notes class+="form-control" %} @@ -121,7 +122,7 @@
Site Details
-

If YES to any of the below, a site visit must be conducted, and an assessment of the venue completed and added to TEC’s records

+

If yes to any of the below, a site visit must be conducted, and an assessment of the venue completed and added to TEC’s records

{% include 'partials/yes_no_radio.html' with formitem=form.known_venue %} {% include 'partials/yes_no_radio.html' with formitem=form.safe_loading %} {% include 'partials/yes_no_radio.html' with formitem=form.safe_storage %} @@ -138,9 +139,9 @@
Structures
{% include 'partials/yes_no_radio.html' with formitem=form.special_structures %} + {% include 'partials/yes_no_radio.html' with formitem=form.suspended_structures %} {% render_field form.persons_responsible_structures class+="form-control mb-3" %} - {% include 'partials/yes_no_radio.html' with formitem=form.suspended_structures %}
diff --git a/RIGS/tests/pages.py b/RIGS/tests/pages.py index 047cdd72..71f7bd3f 100644 --- a/RIGS/tests/pages.py +++ b/RIGS/tests/pages.py @@ -290,7 +290,7 @@ class GenericList(BasePage): class UserPage(BasePage): URL_TEMPLATE = 'user/' - _api_key_selector = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div/div/dl/dd[1]') + _api_key_selector = (By.ID, 'api-key') _cal_url_selector = (By.ID, 'cal-url') _generation_button_selector = (By.LINK_TEXT, 'Generate API Key') diff --git a/users/templates/profile_detail.html b/users/templates/profile_detail.html index c091641f..a7f9970c 100644 --- a/users/templates/profile_detail.html +++ b/users/templates/profile_detail.html @@ -103,7 +103,7 @@ {{user.api_key}} {% else %} - No API Key Generated + No API Key Generated {% endif %} {% if user.api_key %}Reset API Key{% else %}Generate API Key{% endif %}