Add event checkin functionality, seperate power tests into a different form (#536)

* Split power related parts of event checklist into a seperate form

* Revamp H&S overview, remove individual lists.

They were not a good thing.

* Remove old 'vehicle/crew' stuff

* Very initial version of checkin form

* Further work on checkin, add role field etc

* Fix tests after form split

* Add ability to edit checkins, more validation

* Basic checkin/out logic complete

* Add homepage checkin for events happening now

* Minor improvement to homepage UI

* Checkin button turns into checkout button where applicable

* UI work

* Clicking check out does not redirect the user

* Register check in model with the admin site

* Add power record status chip, checklist status chip displays number of checklists

* Minor fixes

* Implement codedoctor suggestions

* pep8

* Add data migration for crew/vehicles

* Checkin only requires login (no perms) and block users from editing other checkins at Django level
This commit is contained in:
2023-05-19 10:28:51 +00:00
committed by GitHub
parent 724762a1e8
commit 01a0b8f831
30 changed files with 1179 additions and 870 deletions

View File

@@ -43,15 +43,22 @@ def venue(db):
@pytest.fixture # TODO parameterise with Event sizes
def checklist(basic_event, venue, admin_user, ra):
checklist = models.EventChecklist.objects.create(event=basic_event, power_mic=admin_user, safe_parking=False,
checklist = models.EventChecklist.objects.create(event=basic_event, safe_parking=False,
safe_packing=False, exits=False, trip_hazard=False, warning_signs=False,
ear_plugs=False, hs_location="Locked away safely",
extinguishers_location="Somewhere, I forgot", earthing=False, pat=False,
extinguishers_location="Somewhere, I forgot",
date=timezone.now(), venue=venue)
yield checklist
checklist.delete()
@pytest.fixture
def power_test(basic_event, venue, admin_user, ra):
power_test = models.PowerTestRecord.objects.create(event=basic_event, venue=venue)
yield power_test
power_test.delete()
@pytest.fixture
def many_events(db, admin_user, scope="class"):
many_events = {