From a5516ee350ff392d20e9ef311dfcd0f3d3e98499 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Tue, 15 Sep 2020 09:30:02 +0100 Subject: [PATCH] Cleanup & Squash migrations --- README.md | 114 ++----------- RIGS/forms.py | 12 +- RIGS/migrations/0039_auto_20200915_0937.py | 181 +++++++++++++++++++++ RIGS/migrations/0039_delete_eventcrew.py | 16 -- RIGS/migrations/0040_delete_rigsversion.py | 16 -- RIGS/migrations/0041_auto_20200528_2253.py | 50 ------ RIGS/migrations/0042_auto_20200703_1513.py | 108 ------------ RIGS/migrations/0043_auto_20200805_1606.py | 25 --- RIGS/migrations/0044_eventchecklist.py | 38 ----- RIGS/migrations/0045_auto_20200824_1431.py | 54 ------ RIGS/migrations/0046_auto_20200828_1246.py | 38 ----- RIGS/migrations/0047_auto_20200829_2105.py | 31 ---- RIGS/migrations/0048_auto_20200829_2201.py | 31 ---- RIGS/migrations/0049_auto_20200829_2313.py | 78 --------- RIGS/migrations/0050_auto_20200830_1048.py | 43 ----- RIGS/migrations/0051_auto_20200830_1115.py | 73 --------- RIGS/migrations/0052_auto_20200830_1117.py | 73 --------- RIGS/migrations/0053_auto_20200830_1940.py | 83 ---------- RIGS/migrations/0054_auto_20200831_1218.py | 33 ---- RIGS/migrations/0055_auto_20200912_0903.py | 21 --- RIGS/models.py | 4 + RIGS/templates/event_checklist_form.html | 16 +- RIGS/templates/event_form.html | 11 +- RIGS/tests/test_functional.py | 7 +- 24 files changed, 219 insertions(+), 937 deletions(-) create mode 100644 RIGS/migrations/0039_auto_20200915_0937.py delete mode 100644 RIGS/migrations/0039_delete_eventcrew.py delete mode 100644 RIGS/migrations/0040_delete_rigsversion.py delete mode 100644 RIGS/migrations/0041_auto_20200528_2253.py delete mode 100644 RIGS/migrations/0042_auto_20200703_1513.py delete mode 100644 RIGS/migrations/0043_auto_20200805_1606.py delete mode 100644 RIGS/migrations/0044_eventchecklist.py delete mode 100644 RIGS/migrations/0045_auto_20200824_1431.py delete mode 100644 RIGS/migrations/0046_auto_20200828_1246.py delete mode 100644 RIGS/migrations/0047_auto_20200829_2105.py delete mode 100644 RIGS/migrations/0048_auto_20200829_2201.py delete mode 100644 RIGS/migrations/0049_auto_20200829_2313.py delete mode 100644 RIGS/migrations/0050_auto_20200830_1048.py delete mode 100644 RIGS/migrations/0051_auto_20200830_1115.py delete mode 100644 RIGS/migrations/0052_auto_20200830_1117.py delete mode 100644 RIGS/migrations/0053_auto_20200830_1940.py delete mode 100644 RIGS/migrations/0054_auto_20200831_1218.py delete mode 100644 RIGS/migrations/0055_auto_20200912_0903.py diff --git a/README.md b/README.md index 8c0adcbe..9d0a155c 100644 --- a/README.md +++ b/README.md @@ -1,111 +1,17 @@ # TEC PA & Lighting - PyRIGS # -[![Build Status](https://travis-ci.org/nottinghamtec/PyRIGS.svg)](https://travis-ci.org/nottinghamtec/PyRIGS) +[![Build Status](https://travis-ci.org/nottinghamtec/PyRIGS.svg?branch=master)](https://travis-ci.org/nottinghamtec/PyRIGS) [![Coverage Status](https://coveralls.io/repos/github/nottinghamtec/PyRIGS/badge.svg)](https://coveralls.io/github/nottinghamtec/PyRIGS) -Welcome to TEC PA & Lightings PyRIGS program. This is a reimplementation of the existing Rig Information Gathering System (RIGS) that was developed using Ruby on Rails. +Welcome to TEC PA & Lighting's PyRIGS program. This is a reimplementation of the previous Rig Information Gathering System (RIGS) that was developed using Ruby on Rails. PyRIGS is our in house app for the centralisation of information on our events and now assets. -The purpose of this project is to make the system more compatible and easier to understand such that should future changes be needed they can be made without having to understand the intricacies of Rails. +For setup information and other such helpful stuff check the [Wiki](https://github.com/nottinghamtec/PyRIGS/wiki) -### What is this repository for? ### -When a significant feature is developed on a branch, raise a pull request and it can be reviewed before being put into production. - -Most of the documents here assume a basic knowledge of how Python and Django work (hint, if I don't say something, Google it, you will find 10000's of answers). The documentation is purely to be specific to TEC's application of the framework. - -### Editing ### -It is recommended that you use the PyCharm IDE by JetBrains. Whilst other editors are available, this is the best for integration with Django as it can automatically manage all the pesky admin commands that frequently need running, as well as nice integration with git. - -For the more experienced developer/somebody who doesn't want a full IDE and wants it to open in less than the age of the universe, I can strongly recommend [Sublime Text](http://www.sublimetext.com/). It has a bit of a steeper learning curve, and won't manage anything Django/git related out of the box, but once you get the hang of it is by far the fastest and most powerful editor I have used (for any type of project). - -Please contact TJP for details on how to acquire these. - -### Python Environment ### -Whilst the Python version used is not critical to the running of the application, using the same version usually helps avoid a lot of issues. Orginally written with the C implementation of Python 2 (CPython 2, specifically the Python 2.7 standard), the application now runs in Python 3. - -Once you have your Python distribution installed, go ahead an follow the steps to set up a virtualenv, which will isolate the project from the system environment. - -#### PyCharm #### -If you are using the prefered PyCharm IDE, then this should be quite easy. - -1. Select "File/Settings" -> "Project Interpreter" -2. Click the small cog in the top right -3. Select "Create VirtualEnv" -4. Enter a name and a location. This doesn't matter where, just make sure it makes sense and you remember it incase you need it later (I recommend calling it "pyrigs" in "~/.virtualenvs/pyrigs") -5. Select the base interpreter to your Python 3 base interpreter (Python 2 will work, just be careful) -6. Click OK, you *don't* want to inherit global packages or make it available to all projects. -7. Open a file such as manage.py. PyCharm should winge that dependances aren't installed. This might take a while to register, but give it change. When it does, click the button to install them and let it do it's thing. If for some reason PyCharm should decide that it doesn't want to help you here, see below for the console instructions on how to do this manually. - -To run the Django application follow these steps - -1. Select "Run/Edit Configurations" -2. Create a new "Django server", give it a sensible name for when you need it later. -3. You might need to set the interpreter to be your virtualenv. -4. Click "OK" -5. Run the application - -#### Console Based #### -If you aren't using PyCharm, or want to use a console for some reason, this is really easy, there is even [virtualenvwrapper](https://virtualenvwrapper.readthedocs.org/en/latest/) to help things along. Simply run -``` -virtualenv -``` -Where dir is the directory you wish to create the virtualenv in. - -Next activate the virtualenv. -``` -Windows -/Scripts/activate.bat - -Unix -source /bin/activate -``` -Finally install the requirements using pip -``` -cd -pip install -r requirements.txt -``` -This might take a while, but be patient and you should then be ready to go. - -To run the server under normal conditions when you are already in the virtualenv (see above) -``` -python manage.py runserver -``` -Please refer to Django documentation for a full list of options available here. - -### Development using docker - -``` -docker build . -t pyrigs -docker run -it --rm -p=8000:8000 -v $(pwd):/app pyrigs -``` - -### Sample Data ### -Sample data is available to aid local development and user acceptance testing. To load this data into your local database, first ensure the database is empty: -``` -python manage.py flush -``` -Then load the sample data using the command: -``` -python manage.py generateSampleData -``` -4 user accounts are created for convenience: - -|Username |Password | -|---------|---------| -|superuser|superuser| -|finance |finance | -|keyholder|keyholder| -|basic |basic | - -### Testing ### -Tests are contained in 3 files. `RIGS/test_models.py` contains tests for logic within the data models. `RIGS/test_unit.py` contains "Live server" tests, using raw web requests. `RIGS/test_integration.py` contains user interface tests which take control of a web browser. For automated Travis tests, we use [Sauce Labs](https://saucelabs.com). When debugging locally, ensure that you have the latest version of Google Chrome installed, then install [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) and ensure it is on the `PATH`. - -You can run the entire test suite, or you can run specific sections individually. For example, in order of specificity: - -``` -python manage.py test -python manage.py test RIGS.test_models -python manage.py test RIGS.test_models.EventTestCase -python manage.py test RIGS.test_models.EventTestCase.test_current_events - -``` +# Apps +- PyRIGS: Base app, stores 'global' information +- RIGS: Rigboard stuff - event calendar etc +- assets: Database of our kit, testing data etc +- versioning: Our custom logic built on top of django-reversion. Semi-modular. +- users: Our custom logic for registration and profiles. Semi-modular. +- training: SoonTM [![forthebadge](https://forthebadge.com/images/badges/built-with-resentment.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/contains-technical-debt.svg)](https://forthebadge.com) diff --git a/RIGS/forms.py b/RIGS/forms.py index 818c9bb4..f3ac49d3 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -11,6 +11,7 @@ from captcha.fields import ReCaptchaField from reversion import revisions as reversion import simplejson from datetime import datetime +from django.utils import timezone from RIGS import models @@ -182,6 +183,13 @@ class EventChecklistForm(forms.ModelForm): # Parsed from incoming form data by clean, then saved into models when the form is saved items = {} + # Two possible formats + def parsedatetime(self, date_string): + try: + return timezone.make_aware(datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S')) + except ValueError: + return timezone.make_aware(datetime.strptime(date_string, '%Y-%m-%dT%H:%M')) + # There's probably a thousand better ways to do this, but this one is mine def clean(self): vehicles = {key: val for key, val in self.data.items() @@ -221,9 +229,9 @@ class EventChecklistForm(forms.ModelForm): item = models.EventChecklistCrew() item.crewmember = models.Profile.objects.get(pk=self.data['crewmember_' + str(pk)]) - item.start = self.data['start_' + str(pk)] + item.start = self.parsedatetime(self.data['start_' + str(pk)]) item.role = self.data['role_' + str(pk)] - item.end = self.data['end_' + str(pk)] + item.end = self.parsedatetime(self.data['end_' + str(pk)]) item.full_clean('checklist') # item does not have a database pk yet as it isn't saved diff --git a/RIGS/migrations/0039_auto_20200915_0937.py b/RIGS/migrations/0039_auto_20200915_0937.py new file mode 100644 index 00000000..2a0c5c1a --- /dev/null +++ b/RIGS/migrations/0039_auto_20200915_0937.py @@ -0,0 +1,181 @@ +# Generated by Django 3.1 on 2020-09-15 08:37 + +import RIGS.models +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('RIGS', '0038_auto_20200306_2000'), + ] + + operations = [ + migrations.CreateModel( + name='EventChecklist', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('safe_parking', models.BooleanField(help_text='Vehicles parked safely?
(does not obstruct venue access)')), + ('safe_packing', models.BooleanField(help_text='Equipment packed away safely?
(including flightcases)')), + ('exits', models.BooleanField(help_text='Emergency exits clear?')), + ('trip_hazard', models.BooleanField(help_text='Appropriate barriers around kit and cabling secured?')), + ('warning_signs', models.BooleanField(help_text='Warning signs in place?
(strobe, smoke, power etc.)')), + ('ear_plugs', models.BooleanField(help_text='Ear plugs issued to crew where needed?')), + ('hs_location', models.CharField(help_text='Location of Safety Bag/Box', max_length=255)), + ('extinguishers_location', models.CharField(help_text='Location of fire extinguishers', max_length=255)), + ('rcds', models.BooleanField(blank=True, help_text='RCDs installed where needed and tested?', null=True)), + ('supply_test', models.BooleanField(blank=True, help_text='Electrical supplies tested?
(using socket tester)', null=True)), + ('earthing', models.BooleanField(help_text='Equipment appropriately earthed?
(truss, stage, generators etc)')), + ('pat', models.BooleanField(help_text='All equipment in PAT period?')), + ('medium_event', models.BooleanField()), + ('source_rcd', models.BooleanField(blank=True, help_text='Source RCD protected?
(if cable is more than 3m long) ', null=True)), + ('labelling', models.BooleanField(blank=True, help_text='Appropriate and clear labelling on distribution and cabling?', null=True)), + ('fd_voltage_l1', models.IntegerField(blank=True, help_text='L1 - N', null=True, verbose_name='First Distro Voltage L1-N')), + ('fd_voltage_l2', models.IntegerField(blank=True, help_text='L2 - N', null=True, verbose_name='First Distro Voltage L2-N')), + ('fd_voltage_l3', models.IntegerField(blank=True, help_text='L3 - N', null=True, verbose_name='First Distro Voltage L3-N')), + ('fd_phase_rotation', models.BooleanField(blank=True, help_text='Phase Rotation
(if required)', null=True, verbose_name='Phase Rotation')), + ('fd_earth_fault', models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True, verbose_name='Earth Fault Loop Impedance')), + ('fd_pssc', models.IntegerField(blank=True, help_text='Prospective Short Circuit Current', null=True, verbose_name='PSCC')), + ('w1_description', models.CharField(blank=True, help_text='Description', max_length=255, null=True)), + ('w1_polarity', models.BooleanField(blank=True, help_text='Polarity Checked?', null=True)), + ('w1_voltage', models.IntegerField(blank=True, help_text='Voltage', null=True)), + ('w1_earth_fault', models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True)), + ('w2_description', models.CharField(blank=True, help_text='Description', max_length=255, null=True)), + ('w2_polarity', models.BooleanField(blank=True, help_text='Polarity Checked?', null=True)), + ('w2_voltage', models.IntegerField(blank=True, help_text='Voltage', null=True)), + ('w2_earth_fault', models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True)), + ('w3_description', models.CharField(blank=True, help_text='Description', max_length=255, null=True)), + ('w3_polarity', models.BooleanField(blank=True, help_text='Polarity Checked?', null=True)), + ('w3_voltage', models.IntegerField(blank=True, help_text='Voltage', null=True)), + ('w3_earth_fault', models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True)), + ('all_rcds_tested', models.BooleanField(blank=True, help_text='All circuit RCDs tested?
(using test button)', null=True)), + ('public_sockets_tested', models.BooleanField(blank=True, help_text='Public/Performer accessible circuits tested?
(using socket tester)', null=True)), + ('reviewed_at', models.DateTimeField(null=True)), + ], + options={ + 'ordering': ['event'], + 'permissions': [('review_eventchecklist', 'Can review Event Checklists')], + }, + bases=(models.Model, RIGS.models.RevisionMixin), + ), + migrations.CreateModel( + name='EventChecklistCrew', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('role', models.CharField(max_length=255)), + ('start', models.DateTimeField()), + ('end', models.DateTimeField()), + ('checklist', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='crew', to='RIGS.eventchecklist')), + ], + bases=(models.Model, RIGS.models.RevisionMixin), + ), + migrations.CreateModel( + name='EventChecklistVehicle', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('vehicle', models.CharField(max_length=255)), + ('checklist', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='vehicles', to='RIGS.eventchecklist')), + ], + bases=(models.Model, RIGS.models.RevisionMixin), + ), + migrations.CreateModel( + name='RiskAssessment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('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?')), + ('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, 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?', null=True)), + ('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?')), + ('generators', models.BooleanField(help_text='Will generators be used?')), + ('other_companies_power', models.BooleanField(help_text='Will TEC be supplying power to any other companies?')), + ('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, 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?', null=True)), + ('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?')), + ('sound_notes', models.TextField(blank=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?', null=True)), + ('known_venue', models.BooleanField(help_text='Is the event in a venue that you and/or TEC have experience working in?')), + ('safe_loading', models.BooleanField(help_text='Is there a safe load in/out?
e.g. sufficient lighting, flat, not in a crowded area etc.')), + ('safe_storage', models.BooleanField(help_text='Are there areas to safely store equipment?')), + ('area_outside_of_control', models.BooleanField(help_text="Is any part of the work area out of TEC's direct control or openly accessible during the build or breakdown period?")), + ('barrier_required', models.BooleanField(help_text='Is there a requirement for TEC to provide any barrier for security or protection of persons/equipment?')), + ('nonstandard_emergency_procedure', models.BooleanField(help_text="Does the emergency procedure for the event differ from TEC's standard procedures?")), + ('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, help_text='Who are the persons on site responsible for their use?', null=True)), + ('suspended_structures', models.BooleanField(help_text="Are any structures (excluding projector screens and IWBs) being suspended from TEC's structures?")), + ('reviewed_at', models.DateTimeField(null=True)), + ], + options={ + 'ordering': ['event'], + 'permissions': [('review_riskassessment', 'Can review Risk Assessments')], + }, + bases=(models.Model, RIGS.models.RevisionMixin), + ), + migrations.RemoveField( + model_name='eventcrew', + name='event', + ), + migrations.RemoveField( + model_name='eventcrew', + name='user', + ), + migrations.DeleteModel( + name='RIGSVersion', + ), + migrations.RemoveField( + model_name='event', + name='risk_assessment_edit_url', + ), + migrations.AlterField( + model_name='profile', + name='first_name', + field=models.CharField(blank=True, max_length=150, verbose_name='first name'), + ), + migrations.DeleteModel( + name='EventCrew', + ), + migrations.AddField( + model_name='riskassessment', + name='event', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='RIGS.event'), + ), + migrations.AddField( + model_name='riskassessment', + name='power_mic', + field=models.ForeignKey(blank=True, help_text='Who is the Power MIC?', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='power_mic', to=settings.AUTH_USER_MODEL, verbose_name='Power MIC'), + ), + migrations.AddField( + model_name='riskassessment', + name='reviewed_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Reviewer'), + ), + migrations.AddField( + model_name='eventchecklistvehicle', + name='driver', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vehicles', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='eventchecklistcrew', + name='crewmember', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='crewed', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='eventchecklist', + name='event', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='RIGS.event'), + ), + migrations.AddField( + model_name='eventchecklist', + name='power_mic', + field=models.ForeignKey(help_text='Who is the Power MIC?', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='checklists', to=settings.AUTH_USER_MODEL, verbose_name='Power MIC'), + ), + migrations.AddField( + model_name='eventchecklist', + name='reviewed_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Reviewer'), + ), + ] diff --git a/RIGS/migrations/0039_delete_eventcrew.py b/RIGS/migrations/0039_delete_eventcrew.py deleted file mode 100644 index 51576883..00000000 --- a/RIGS/migrations/0039_delete_eventcrew.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.3 on 2020-03-18 00:24 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0038_auto_20200306_2000'), - ] - - operations = [ - migrations.DeleteModel( - name='EventCrew', - ), - ] diff --git a/RIGS/migrations/0040_delete_rigsversion.py b/RIGS/migrations/0040_delete_rigsversion.py deleted file mode 100644 index 4e4fda6c..00000000 --- a/RIGS/migrations/0040_delete_rigsversion.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.3 on 2020-04-15 18:40 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0039_delete_eventcrew'), - ] - - operations = [ - migrations.DeleteModel( - name='RIGSVersion', - ), - ] diff --git a/RIGS/migrations/0041_auto_20200528_2253.py b/RIGS/migrations/0041_auto_20200528_2253.py deleted file mode 100644 index 326aedfd..00000000 --- a/RIGS/migrations/0041_auto_20200528_2253.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-28 21:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0040_delete_rigsversion'), - ] - - operations = [ - migrations.RemoveField( - model_name='event', - name='risk_assessment_edit_url', - ), - migrations.CreateModel( - name='RiskAssessment', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nonstandard_equipment', models.BooleanField(default=False, 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(default=False, 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(default=False, help_text='Are you using any external contractors?')), - ('other_companies', models.BooleanField(default=False, help_text='Are TEC working with any other companies on site?')), - ('crew_fatigue', models.BooleanField(default=False, help_text='Is crew fatigue likely to be a risk at any point during this event?')), - ('general_notes', models.TextField(blank=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?', null=True)), - ('big_power', models.BooleanField(default=False, help_text='Does the event require larger power supplies than 13A or 16A single phase wall sockets, or draw more than 20A total current?')), - ('generators', models.BooleanField(default=False, help_text='Will generators be used?')), - ('other_companies_power', models.BooleanField(default=False, help_text='Will TEC be supplying power to any other companies?')), - ('nonstandard_equipment_power', models.BooleanField(default=False, 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(default=False, help_text='Will the electrical installation occupy more than one electrical environment?')), - ('power_notes', models.TextField(blank=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?', null=True)), - ('noise_monitoring', models.BooleanField(default=False, 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?')), - ('sound_notes', models.TextField(blank=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?', null=True)), - ('known_venue', models.BooleanField(default=False, help_text='Is the event in a venue that you and/or TEC have experience working in?')), - ('safe_loading', models.BooleanField(default=False, help_text='Is there a safe load in/out?
e.g. sufficient lighting, flat, not in a crowded area etc.')), - ('safe_storage', models.BooleanField(default=False, help_text='Are there areas to safely store equipment?')), - ('area_outside_of_control', models.BooleanField(default=False, help_text="Is any part of the work area out of TEC's direct control or openly accessible during the build or breakdown period?")), - ('barrier_required', models.BooleanField(default=False, help_text='Is there a requirement for TEC to provide any barrier for security or protection of persons/equipment?')), - ('nonstandard_emergency_procedure', models.BooleanField(default=False, help_text="Does the emergency procedure for the event differ from TEC's standard procedures?")), - ('special_structures', models.BooleanField(default=False, help_text='Does the event require use of winch stands, motors, MPT Towers, or staging?')), - ('persons_responsible_structures', models.TextField(blank=True, help_text='Who are the persons on site responsible for their use?', null=True)), - ('suspended_structures', models.BooleanField(default=False, help_text="Are any structures (excluding projector screens and IWBs) being suspended from TEC's structures?")), - ('event', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='RIGS.Event')), - ('power_mic', models.ForeignKey(blank=True, help_text='Who is the Power MIC?', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='power_mic', to=settings.AUTH_USER_MODEL, verbose_name='Power MIC')), - ], - ), - ] diff --git a/RIGS/migrations/0042_auto_20200703_1513.py b/RIGS/migrations/0042_auto_20200703_1513.py deleted file mode 100644 index 735b8e3e..00000000 --- a/RIGS/migrations/0042_auto_20200703_1513.py +++ /dev/null @@ -1,108 +0,0 @@ -# Generated by Django 3.0.7 on 2020-07-03 14:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0041_auto_20200528_2253'), - ] - - operations = [ - migrations.AlterField( - model_name='riskassessment', - name='area_outside_of_control', - field=models.BooleanField(help_text="Is any part of the work area out of TEC's direct control or openly accessible during the build or breakdown period?"), - ), - migrations.AlterField( - model_name='riskassessment', - name='barrier_required', - field=models.BooleanField(help_text='Is there a requirement for TEC to provide any barrier for security or protection of persons/equipment?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='big_power', - field=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?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='contractors', - field=models.BooleanField(help_text='Are you using any external contractors?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='crew_fatigue', - field=models.BooleanField(help_text='Is crew fatigue likely to be a risk at any point during this event?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='generators', - field=models.BooleanField(help_text='Will generators be used?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='known_venue', - field=models.BooleanField(help_text='Is the event in a venue that you and/or TEC have experience working in?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='multiple_electrical_environments', - field=models.BooleanField(help_text='Will the electrical installation occupy more than one electrical environment?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='noise_monitoring', - field=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?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='nonstandard_emergency_procedure', - field=models.BooleanField(help_text="Does the emergency procedure for the event differ from TEC's standard procedures?"), - ), - 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='nonstandard_equipment_power', - field=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?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='nonstandard_use', - field=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'), - ), - migrations.AlterField( - model_name='riskassessment', - name='other_companies', - field=models.BooleanField(help_text='Are TEC working with any other companies on site?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='other_companies_power', - field=models.BooleanField(help_text='Will TEC be supplying power to any other companies?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='safe_loading', - field=models.BooleanField(help_text='Is there a safe load in/out?
e.g. sufficient lighting, flat, not in a crowded area etc.'), - ), - migrations.AlterField( - model_name='riskassessment', - name='safe_storage', - field=models.BooleanField(help_text='Are there areas to safely store equipment?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='special_structures', - field=models.BooleanField(help_text='Does the event require use of winch stands, motors, MPT Towers, or staging?'), - ), - migrations.AlterField( - model_name='riskassessment', - name='suspended_structures', - field=models.BooleanField(help_text="Are any structures (excluding projector screens and IWBs) being suspended from TEC's structures?"), - ), - ] diff --git a/RIGS/migrations/0043_auto_20200805_1606.py b/RIGS/migrations/0043_auto_20200805_1606.py deleted file mode 100644 index 95782b66..00000000 --- a/RIGS/migrations/0043_auto_20200805_1606.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.0.7 on 2020-08-05 15:06 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0042_auto_20200703_1513'), - ] - - operations = [ - migrations.AddField( - model_name='riskassessment', - name='reviewed_at', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='riskassessment', - name='reviewed_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Reviewer'), - ), - ] diff --git a/RIGS/migrations/0044_eventchecklist.py b/RIGS/migrations/0044_eventchecklist.py deleted file mode 100644 index f16ed9b3..00000000 --- a/RIGS/migrations/0044_eventchecklist.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.0.7 on 2020-08-14 15:28 - -import RIGS.models -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0043_auto_20200805_1606'), - ] - - operations = [ - migrations.CreateModel( - name='EventChecklist', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('vehicles', models.TextField(help_text='List vehicles and their drivers')), - ('safe_parking', models.BooleanField(help_text='Vehicles parked safely?(does not obstruct venue access)')), - ('safe_packing', models.BooleanField(help_text='Equipment packed away safely?(including flightcases)')), - ('exits', models.BooleanField(help_text='Emergency exits clear?')), - ('trip_hazard', models.BooleanField(help_text='Appropriate barriers around kit and cabling secured?')), - ('warning_signs', models.BooleanField(help_text='Warning signs in place?(strobe, smoke, power etc.)')), - ('ear_plugs', models.BooleanField(help_text='Ear plugs issued to crew where needed?')), - ('hs_location', models.TextField(help_text='Location of Safety Bag/Box')), - ('extinguishers_location', models.TextField(help_text='Location of fire extinguishers')), - ('rcds', models.BooleanField(help_text='RCDs installed where needed and tested?')), - ('supply_test', models.BooleanField(help_text='Electrical supplies tested?(using socket tester)')), - ('earthing', models.BooleanField(help_text='Equipment appropriately earthed?(truss, stage, etc)')), - ('pat', models.BooleanField(help_text='All equipment in PAT period?')), - ('event', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='RIGS.Event')), - ('power_mic', models.ForeignKey(blank=True, help_text='Who is the Power MIC?', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='checklist', to=settings.AUTH_USER_MODEL, verbose_name='Power MIC')), - ], - bases=(models.Model, RIGS.models.RevisionMixin), - ), - ] diff --git a/RIGS/migrations/0045_auto_20200824_1431.py b/RIGS/migrations/0045_auto_20200824_1431.py deleted file mode 100644 index c83d402b..00000000 --- a/RIGS/migrations/0045_auto_20200824_1431.py +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by Django 3.0.7 on 2020-08-24 13:31 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0044_eventchecklist'), - ] - - operations = [ - migrations.AddField( - model_name='eventchecklist', - name='medium_event', - field=models.BooleanField(default=False), - preserve_default=False, - ), - migrations.AlterField( - model_name='eventchecklist', - name='earthing', - field=models.BooleanField(help_text='Equipment appropriately earthed?
(truss, stage, etc)'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='extinguishers_location', - field=models.CharField(help_text='Location of fire extinguishers', max_length=255), - ), - migrations.AlterField( - model_name='eventchecklist', - name='hs_location', - field=models.CharField(help_text='Location of Safety Bag/Box', max_length=255), - ), - migrations.AlterField( - model_name='eventchecklist', - name='safe_packing', - field=models.BooleanField(help_text='Equipment packed away safely?
(including flightcases)'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='safe_parking', - field=models.BooleanField(help_text='Vehicles parked safely?
(does not obstruct venue access)'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='supply_test', - field=models.BooleanField(help_text='Electrical supplies tested?
(using socket tester)'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='warning_signs', - field=models.BooleanField(help_text='Warning signs in place?
(strobe, smoke, power etc.)'), - ), - ] diff --git a/RIGS/migrations/0046_auto_20200828_1246.py b/RIGS/migrations/0046_auto_20200828_1246.py deleted file mode 100644 index 18b7dfa7..00000000 --- a/RIGS/migrations/0046_auto_20200828_1246.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.1 on 2020-08-28 11:46 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0045_auto_20200824_1431'), - ] - - operations = [ - migrations.RemoveField( - model_name='eventchecklist', - name='vehicles', - ), - migrations.AlterField( - model_name='eventchecklist', - name='power_mic', - field=models.ForeignKey(help_text='Who is the Power MIC?', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='checklists', to=settings.AUTH_USER_MODEL, verbose_name='Power MIC'), - ), - migrations.AlterField( - model_name='profile', - name='first_name', - field=models.CharField(blank=True, max_length=150, verbose_name='first name'), - ), - migrations.CreateModel( - name='EventChecklistVehicle', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('vehicle', models.CharField(max_length=255)), - ('checklist', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='vehicles', to='RIGS.eventchecklist')), - ('driver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='drivers', to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/RIGS/migrations/0047_auto_20200829_2105.py b/RIGS/migrations/0047_auto_20200829_2105.py deleted file mode 100644 index 6b5148cb..00000000 --- a/RIGS/migrations/0047_auto_20200829_2105.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.1 on 2020-08-29 20:05 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0046_auto_20200828_1246'), - ] - - operations = [ - migrations.AlterField( - model_name='eventchecklistvehicle', - name='driver', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vehicles', to=settings.AUTH_USER_MODEL), - ), - migrations.CreateModel( - name='EventChecklistCrew', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('role', models.CharField(max_length=255, null=True)), - ('start', models.DateTimeField(blank=True, null=True)), - ('end', models.DateTimeField(blank=True, null=True)), - ('checklist', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='crew', to='RIGS.eventchecklist')), - ('crewmember', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='crewed', to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/RIGS/migrations/0048_auto_20200829_2201.py b/RIGS/migrations/0048_auto_20200829_2201.py deleted file mode 100644 index e3f68956..00000000 --- a/RIGS/migrations/0048_auto_20200829_2201.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.1 on 2020-08-29 21:01 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0047_auto_20200829_2105'), - ] - - operations = [ - migrations.AlterField( - model_name='eventchecklistcrew', - name='end', - field=models.DateTimeField(default=None), - preserve_default=False, - ), - migrations.AlterField( - model_name='eventchecklistcrew', - name='role', - field=models.CharField(default=None, max_length=255), - preserve_default=False, - ), - migrations.AlterField( - model_name='eventchecklistcrew', - name='start', - field=models.DateTimeField(default=None), - preserve_default=False, - ), - ] diff --git a/RIGS/migrations/0049_auto_20200829_2313.py b/RIGS/migrations/0049_auto_20200829_2313.py deleted file mode 100644 index be56d711..00000000 --- a/RIGS/migrations/0049_auto_20200829_2313.py +++ /dev/null @@ -1,78 +0,0 @@ -# Generated by Django 3.1 on 2020-08-29 22:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0048_auto_20200829_2201'), - ] - - operations = [ - migrations.AddField( - model_name='eventchecklist', - name='all_rcds_tested', - field=models.BooleanField(default=False, help_text='All circuit RCDs tested?(using test button)'), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='fd_earth_fault', - field=models.IntegerField(default=False, help_text='Earth Fault Loop Impedance (ZS)'), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='fd_phase_rotation', - field=models.BooleanField(default=False, help_text='Phase Rotation
(if required)'), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='fd_pssc', - field=models.IntegerField(default=False, help_text='Prospective Short Circuit Current'), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='fd_voltage_l1', - field=models.IntegerField(default=False), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='fd_voltage_l2', - field=models.IntegerField(default=False), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='fd_voltage_l3', - field=models.IntegerField(default=False), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='labelling', - field=models.BooleanField(default=False, help_text='Appropriate and clear labelling on distribution and cabling?'), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='public_sockets_tested', - field=models.BooleanField(default=False, help_text='Public/Performer accessible circuits tested?(using socket tester)'), - preserve_default=False, - ), - migrations.AddField( - model_name='eventchecklist', - name='source_rcd', - field=models.BooleanField(default=False, help_text='Source RCD protected?
(if cable is more than 3m long) '), - preserve_default=False, - ), - migrations.AlterField( - model_name='eventchecklist', - name='earthing', - field=models.BooleanField(help_text='Equipment appropriately earthed?
(truss, stage, generators etc)'), - ), - ] diff --git a/RIGS/migrations/0050_auto_20200830_1048.py b/RIGS/migrations/0050_auto_20200830_1048.py deleted file mode 100644 index 8d93bf95..00000000 --- a/RIGS/migrations/0050_auto_20200830_1048.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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/migrations/0051_auto_20200830_1115.py b/RIGS/migrations/0051_auto_20200830_1115.py deleted file mode 100644 index bd845846..00000000 --- a/RIGS/migrations/0051_auto_20200830_1115.py +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by Django 3.1 on 2020-08-30 10:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0050_auto_20200830_1048'), - ] - - operations = [ - migrations.AlterField( - model_name='eventchecklist', - name='all_rcds_tested', - field=models.BooleanField(blank=True, help_text='All circuit RCDs tested?(using test button)'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_earth_fault', - field=models.IntegerField(blank=True, 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(blank=True, help_text='Phase Rotation
(if required)', verbose_name='Phase Rotation'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_pssc', - field=models.IntegerField(blank=True, help_text='Prospective Short Circuit Current', verbose_name='PSCC'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_voltage_l1', - field=models.IntegerField(blank=True, help_text='L1 - N', verbose_name='First Distro Voltage L1-N'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_voltage_l2', - field=models.IntegerField(blank=True, help_text='L2 - N', verbose_name='First Distro Voltage L2-N'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_voltage_l3', - field=models.IntegerField(blank=True, help_text='L3 - N', verbose_name='First Distro Voltage L3-N'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='labelling', - field=models.BooleanField(blank=True, help_text='Appropriate and clear labelling on distribution and cabling?'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='public_sockets_tested', - field=models.BooleanField(blank=True, help_text='Public/Performer accessible circuits tested?(using socket tester)'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='rcds', - field=models.BooleanField(blank=True, help_text='RCDs installed where needed and tested?'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='source_rcd', - field=models.BooleanField(blank=True, help_text='Source RCD protected?
(if cable is more than 3m long) '), - ), - migrations.AlterField( - model_name='eventchecklist', - name='supply_test', - field=models.BooleanField(blank=True, help_text='Electrical supplies tested?
(using socket tester)'), - ), - ] diff --git a/RIGS/migrations/0052_auto_20200830_1117.py b/RIGS/migrations/0052_auto_20200830_1117.py deleted file mode 100644 index 7ef4d10d..00000000 --- a/RIGS/migrations/0052_auto_20200830_1117.py +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by Django 3.1 on 2020-08-30 10:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0051_auto_20200830_1115'), - ] - - operations = [ - migrations.AlterField( - model_name='eventchecklist', - name='all_rcds_tested', - field=models.BooleanField(blank=True, help_text='All circuit RCDs tested?(using test button)', null=True), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_earth_fault', - field=models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True, verbose_name='Earth Fault Loop Impedance'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_phase_rotation', - field=models.BooleanField(blank=True, help_text='Phase Rotation
(if required)', null=True, verbose_name='Phase Rotation'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_pssc', - field=models.IntegerField(blank=True, help_text='Prospective Short Circuit Current', null=True, verbose_name='PSCC'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_voltage_l1', - field=models.IntegerField(blank=True, help_text='L1 - N', null=True, verbose_name='First Distro Voltage L1-N'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_voltage_l2', - field=models.IntegerField(blank=True, help_text='L2 - N', null=True, verbose_name='First Distro Voltage L2-N'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='fd_voltage_l3', - field=models.IntegerField(blank=True, help_text='L3 - N', null=True, verbose_name='First Distro Voltage L3-N'), - ), - migrations.AlterField( - model_name='eventchecklist', - name='labelling', - field=models.BooleanField(blank=True, help_text='Appropriate and clear labelling on distribution and cabling?', null=True), - ), - migrations.AlterField( - model_name='eventchecklist', - name='public_sockets_tested', - field=models.BooleanField(blank=True, help_text='Public/Performer accessible circuits tested?(using socket tester)', null=True), - ), - migrations.AlterField( - model_name='eventchecklist', - name='rcds', - field=models.BooleanField(blank=True, help_text='RCDs installed where needed and tested?', null=True), - ), - migrations.AlterField( - model_name='eventchecklist', - name='source_rcd', - field=models.BooleanField(blank=True, help_text='Source RCD protected?
(if cable is more than 3m long) ', null=True), - ), - migrations.AlterField( - model_name='eventchecklist', - name='supply_test', - field=models.BooleanField(blank=True, help_text='Electrical supplies tested?
(using socket tester)', null=True), - ), - ] diff --git a/RIGS/migrations/0053_auto_20200830_1940.py b/RIGS/migrations/0053_auto_20200830_1940.py deleted file mode 100644 index 558dd21f..00000000 --- a/RIGS/migrations/0053_auto_20200830_1940.py +++ /dev/null @@ -1,83 +0,0 @@ -# Generated by Django 3.1 on 2020-08-30 18:40 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0052_auto_20200830_1117'), - ] - - operations = [ - migrations.AddField( - model_name='eventchecklist', - name='w1_description', - field=models.CharField(blank=True, help_text='Description', max_length=255, null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w1_earth_fault', - field=models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w1_polarity', - field=models.BooleanField(blank=True, help_text='Polarity Checked?', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w1_voltage', - field=models.IntegerField(blank=True, help_text='Voltage', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w2_description', - field=models.CharField(blank=True, help_text='Description', max_length=255, null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w2_earth_fault', - field=models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w2_polarity', - field=models.BooleanField(blank=True, help_text='Polarity Checked?', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w2_voltage', - field=models.IntegerField(blank=True, help_text='Voltage', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w3_description', - field=models.CharField(blank=True, help_text='Description', max_length=255, null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w3_earth_fault', - field=models.IntegerField(blank=True, help_text='Earth Fault Loop Impedance (ZS)', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w3_polarity', - field=models.BooleanField(blank=True, help_text='Polarity Checked?', null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='w3_voltage', - field=models.IntegerField(blank=True, help_text='Voltage', null=True), - ), - migrations.AlterField( - model_name='eventchecklist', - name='all_rcds_tested', - field=models.BooleanField(blank=True, help_text='All circuit RCDs tested?
(using test button)', null=True), - ), - migrations.AlterField( - model_name='eventchecklist', - name='public_sockets_tested', - field=models.BooleanField(blank=True, help_text='Public/Performer accessible circuits tested?
(using socket tester)', null=True), - ), - ] diff --git a/RIGS/migrations/0054_auto_20200831_1218.py b/RIGS/migrations/0054_auto_20200831_1218.py deleted file mode 100644 index f4dcb0a6..00000000 --- a/RIGS/migrations/0054_auto_20200831_1218.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.1 on 2020-08-31 11:18 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0053_auto_20200830_1940'), - ] - - operations = [ - migrations.AlterModelOptions( - name='eventchecklist', - options={'ordering': ['event'], 'permissions': [('eventchecklist_review', 'Can review ECs')]}, - ), - migrations.AlterModelOptions( - name='riskassessment', - options={'ordering': ['event'], 'permissions': [('riskassessment_review', 'Can review RAs')]}, - ), - migrations.AddField( - model_name='eventchecklist', - name='reviewed_at', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='eventchecklist', - name='reviewed_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Reviewer'), - ), - ] diff --git a/RIGS/migrations/0055_auto_20200912_0903.py b/RIGS/migrations/0055_auto_20200912_0903.py deleted file mode 100644 index d1947e11..00000000 --- a/RIGS/migrations/0055_auto_20200912_0903.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1 on 2020-09-12 08:03 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('RIGS', '0054_auto_20200831_1218'), - ] - - operations = [ - migrations.AlterModelOptions( - name='eventchecklist', - options={'ordering': ['event'], 'permissions': [('review_eventchecklist', 'Can review Event Checklists')]}, - ), - migrations.AlterModelOptions( - name='riskassessment', - options={'ordering': ['event'], 'permissions': [('review_riskassessment', 'Can review Risk Assessments')]}, - ), - ] diff --git a/RIGS/models.py b/RIGS/models.py index fa984276..9b9c13cc 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -781,5 +781,9 @@ class EventChecklistCrew(models.Model, RevisionMixin): reversion_hide = True + def clean(self): + if self.start > self.end: + raise ValidationError('Unless you\'ve invented time travel, crew can\'t finish before they have started.') + def __str__(self): return "{} ({})".format(str(self.crewmember), self.role) diff --git a/RIGS/templates/event_checklist_form.html b/RIGS/templates/event_checklist_form.html index ae3827d5..bbfef295 100644 --- a/RIGS/templates/event_checklist_form.html +++ b/RIGS/templates/event_checklist_form.html @@ -85,8 +85,8 @@ }); //Somewhat rudimentary way of ensuring people fill in completely (if it hits the database validation the whole table row disappears when the page reloads...) //the not is to avoid adding it to some of bootstrap-selects extra crap - $('#vehiclest,#crewmemberst').find("select,input[type!='search']").change(function () { - $(this).closest('tr').find('input,select').attr('required', 'true'); + $('#vehiclest,#crewmemberst').find("select,input").not(':input[type=search]').change(function () { + $(this).closest('tr').find("select,input").not(':input[type=search]').attr('required', 'true'); }); }); @@ -141,7 +141,7 @@ - + @@ -207,7 +207,7 @@ - + diff --git a/RIGS/templates/event_form.html b/RIGS/templates/event_form.html index f962977d..9a166d4b 100644 --- a/RIGS/templates/event_form.html +++ b/RIGS/templates/event_form.html @@ -150,18 +150,15 @@ {# New rig buttons #} {% if not object.pk %}
-
-
+
+
- + - - - - +
diff --git a/RIGS/tests/test_functional.py b/RIGS/tests/test_functional.py index c2cad4cc..06e78d60 100644 --- a/RIGS/tests/test_functional.py +++ b/RIGS/tests/test_functional.py @@ -330,9 +330,6 @@ class TestEventCreate(BaseRigboardTest): self.page.submit() self.assertTrue(self.page.success) - def test_subhire_creation(self): - pass - @screenshot_failure_cls class TestEventDuplicate(BaseRigboardTest): @@ -1053,9 +1050,9 @@ class TestHealthAndSafety(BaseRigboardTest): start_time = base_regions.DateTimePicker(self.page, self.driver.find_element(By.XPATH, '//*[@name="start_-1"]')) end_time = base_regions.DateTimePicker(self.page, self.driver.find_element(By.XPATH, '//*[@name="end_-1"]')) - start_time.set_value(datetime.datetime(2015, 1, 1, 9, 0)) + start_time.set_value(timezone.make_aware(datetime.datetime(2015, 1, 1, 9, 0))) # TODO Validation of end before start - end_time.set_value(datetime.datetime(2015, 1, 1, 10, 30)) + end_time.set_value(timezone.make_aware(datetime.datetime(2015, 1, 1, 10, 30))) crew_select.search(crew.name) crew_select.toggle() self.driver.find_element(By.XPATH, '//*[@name="role_-1"]').send_keys(role)