diff --git a/RIGS/migrations/0046_auto_20201213_1625.py b/RIGS/migrations/0046_auto_20201213_1625.py
new file mode 100644
index 00000000..738d452e
--- /dev/null
+++ b/RIGS/migrations/0046_auto_20201213_1625.py
@@ -0,0 +1,34 @@
+# Generated by Django 3.1.2 on 2020-12-13 16:25
+
+import RIGS.models
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('RIGS', '0045_auto_20201116_1808'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='riskassessment',
+ name='power_plan',
+ field=models.URLField(blank=True, help_text="Upload your power plan to the Sharepoint and submit a link", null=True, validators=[RIGS.models.validate_url]),
+ ),
+ migrations.AddField(
+ model_name='riskassessment',
+ name='rigging_plan',
+ field=models.URLField(blank=True, help_text="Upload your rigging plan to the Sharepoint and submit a link", null=True, validators=[RIGS.models.validate_url]),
+ ),
+ 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='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 3fab3e27..d376540d 100644
--- a/RIGS/models.py
+++ b/RIGS/models.py
@@ -19,6 +19,8 @@ from decimal import Decimal
from django.core.exceptions import ValidationError
from django.urls import reverse_lazy
+from urllib.parse import urlparse
+
class Profile(AbstractUser):
initials = models.CharField(max_length=5, unique=True, null=True, blank=False)
@@ -610,6 +612,14 @@ class Payment(models.Model, RevisionMixin):
return str("payment at £{}".format(self.amount))
+def validate_url(value):
+ if not value:
+ return # Required error is done the field
+ obj = urlparse(value)
+ if not obj.hostname in ('nottinghamtec.sharepoint.com'):
+ raise ValidationError('URL must point to a location on the TEC Sharepoint')
+
+
@reversion.register
class RiskAssessment(models.Model, RevisionMixin):
event = models.OneToOneField('Event', on_delete=models.CASCADE)
@@ -617,8 +627,8 @@ class RiskAssessment(models.Model, RevisionMixin):
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?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")
+ 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?")
@@ -633,6 +643,7 @@ class RiskAssessment(models.Model, RevisionMixin):
nonstandard_equipment_power = models.BooleanField(help_text="Does the power plan require the use of any power equipment (distros, dimmers, motor controllers, etc.) that does not belong to TEC?")
multiple_electrical_environments = models.BooleanField(help_text="Will the electrical installation occupy more than one electrical environment?")
power_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_plan = models.URLField(blank=True, null=True, help_text="Upload your power plan to the Sharepoint and submit a link", validators=[validate_url])
# Sound
noise_monitoring = models.BooleanField(help_text="Does the event require noise monitoring or any non-standard procedures in order to comply with health and safety legislation or site rules?")
@@ -650,6 +661,7 @@ class RiskAssessment(models.Model, RevisionMixin):
special_structures = models.BooleanField(help_text="Does the event require use of winch stands, motors, MPT Towers, or staging?")
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?")
+ rigging_plan = models.URLField(blank=True, null=True, help_text="Upload your rigging plan to the Sharepoint and submit a link", validators=[validate_url])
# Blimey that was a lot of options
diff --git a/RIGS/templates/risk_assessment_detail.html b/RIGS/templates/risk_assessment_detail.html
index a6d05b3f..1866ceb8 100644
--- a/RIGS/templates/risk_assessment_detail.html
+++ b/RIGS/templates/risk_assessment_detail.html
@@ -2,6 +2,7 @@
{% block title %}Risk Assessment for Event N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}{% endblock %}
{% load help_text from filters %}
{% load yesnoi from filters %}
+{% load linkornone from filters %}
{% block content %}