* Add fields to rig info for additional access requirements
* Add form field for additional access requirements
* Display access requirements in rig info
* Make access requirements field non-required
Oops...
* Add event access field to risk assessment
* Allow for modification and display risk assessment venue access item
* Correct tests for RAs with new parking fields
* Add note to new venue access component of RA
* Correct div boundaries for non-rig access requirements
* Fill parking and access field in sample data generator
* Set parking and access field to false in RA creation test
* Hopefully the final correction of the RA test suite
* Disable thousands separation in locale settings that caused issues updating rigs
* Update invoice dashboard to use "g" suffixed floatformats for thousands separation
* Enable commas for float thousands separation
* Add new invoice dashboard template
* Add new view controller for finance dashboard
* Add finance dashboard to dropdown
* Update finance URLs to put dashboard at index route
* Add payment methods to generated sample data
* Flip 'outstanding' and 'waiting' cards on dashboard to match order in dropdown
Also made them link to their respective lists and fixed low text contrast
---------
Co-authored-by: FreneticScribbler <aj@aronajones.com>
* Add new block to base_print.xml for additional styles from downstream templates
* Fix page totals on exports by adding <namedString> element
* Add new print template for power test records
* Add a generated name property to power tests to allow for export
* Add new routes for print export for power tests
* Add print button to power test records view page
* Address linting errors
* Revive this concept for 2023
(cherry picked from commit b3939d8426)
# Conflicts:
# pipeline/source_assets/scss/dark_screen.scss
* Update app.json
* Updates to all three layouts
Ignore versions for "None" models, such as where the model has subsequently been deleted (eventchecklistcrew and eventchecklistvehicle). Now it makes sense...
Another silly copy paste error from ECs. Also really makes me want 'repeatable fragments' in Django templating so that the top and bottom page buttons could actually be the same...
Bloody *hell* that was hard to track down. Looks like there's somehow versioning data for eventchecklistcrew and eventchecklistvehicle hanging around which the included patch skips over for...reasons. I don't know why it works, why it ever worked before, or much of anything really. Send it.
* Add button for creating forum thread draft from event detail
TODO: Allow RIGS to ingest POST requests sent from the forum on new posts in RIG info to link up the forum thread
RE https://forum.nottinghamtec.co.uk/t/rigs-discourse-integration/15592/21
* Mockup webhook recieving view
* Correct method of CRSF exemption for webhook reciever
* Use f-strings correctly, not like a big dumb
* That was also dumb, fix that too
* Second shot at webhook reciever
* Oops
* >.<
* Third shot
* Try again at signing
* What if I gave it the right arguments. That might be a good start.
* More fiddling with auth
* Add debug print
* Okay, put that back where it was because I inavertently overloaded my import
Flashbacks to my java days...
* Different header access method
* Fix import, again
* Fix ommited json parsing wotsit
* Fix url
* Fix string index
* Correct template logic
* Allow manual adding/editing of URLs
* Filter by right flavour of event
* Amend event str conversion for consistency
* Oops
* Make migration
Will be squashed later
* Fix logic when creating events
* Squash migration
* Implement codedoctor suggestion
* Add absolute URL to power tests
* Update to target Python 3.10
* Return user to current page when clicking 'mark reviewed'
* Add units to power test record detail and form
I'm a bad scientist (coz I'm an engineer)
* Allow a higher value in PSSC fields
* Default venue to event venue in EC/PT
* Fix population of initial venue values for EC/PT
* Add link to create power test from EC detail
* Do not set power plan field to required on RA
"This might be a problem if the risk assessment is being done by one person and the power plan by another."
* Default power MIC to MIC
* Implement some suggestions from the Doctor
* Prevent checking in to cancelled events and dry hires
Will close#539
* Exclude dry hires from H&S overview list
* Add "ex VAT" tooltips to asset purchase price and replacement cost
* Automagically clear and focus ID field when audit modal closes
Closes#533
* Delete unused things
* Allow two decimal places in cable length, show training item IDs in selectpicker
Will close#540
* Fix#524 500 Error when viewing qualification list for items nobody is qualified in
* Update README.md
* Add a guard against nulls in recent changes
Maybe fixes#537 I'm unable to replicate locally
* Turn down verbosity of CI tests, fix tests, potential speedup
* Squash migration
* Add encoding to open
* Update to v3 upload-artifact
Resolves a deprecation warning
* 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
* Add 'description' field to TrainingItems
Renamed existing field to name, removed the dummy property.
* Initial version of training item export view
* Fix line length issue and better spacing on exported PDF
* Added export button to item list
* pep8
* Implement code doctor tweaks
* Attempt to fix odd deployment issue
* Pad headers slightly
* Fix page numbering
Currently performs two functions:
1. Inactivates users that have not logged in for at least one year. Closes#478 (Need to circle back round to full deletion SoonTM)
2. Ensures the supervisor database flag is set correctly for each user
This is run automatically by the Heroku Scheduler addon at midnight daily.
* Add basic markdown support site wide
* Improved MD support.
Add some styling for images in MD
Add support for the bastardisation of the MD html for RML.
* Add processing for <ul> in RML
* Add OL processing to RML
* Fix a bug with squares appearing around the last page number
* Remove rml formatting in event_detail
* Improve handling of code blocks in RML
* Add MD to rigboard
Reduce MD title sizes as they were offensively large
* Add parsing of markdown when editing event items
* Improved list handling in RML
* Add tests for markdown support.
Focuses mainly on RML as that's where it will break
* Add indications of where MD support is enabled as per comment by @samozzy in #178.
Isn't quite a full description, but for the most part this should be enough for the people who know how to use it see where they can use it.
* Add failing test for markdown processing none
* Fix for failing test in e0d56e
* Add failing test for using single line breaks as per comment on #214
* Enable line break extension for single breaks in paragraphs by new lines.
Pass tests in ef3de607c3
* Enable GH flavour linebreaks in JS rendered markdown
* Made RML bullets pretty :)
* Added WYSIWYG editor. Works for notes & description, fails miserably for items :(
* Fixed for event items. Will probably fail tests because selenium can't type in simpleMDE :(
* FIX: Re-enable markdown on paperwork
Strikethrough is broken in all sorts of places for whatever reason
* FEAT: Markdown support on asset comments
* FIX: Prevent js injection through markdown fields
* Initial fixes
* Basic dark theme for simplemde
* Swap to locally delivered SimpleMDE
* Region for selenium testing of SimpleMDE
Bleh, Javascript all around
* Tests passing!
Fixed not using region for item modal, and overflow error on paperwork with really long description. Looks junk but I'm not really bothered
* Pep8 fixes
* Fallback for null HCapatcha sitekey
I.e. when we're on a branch
* Fix item description print being broken
* Actually fix sitekey problem
* Fixes for using markdown in asset comments
* Properly initialise markdown on asset comments
Co-authored-by: David Taylor <david@taylorhq.com>
Co-authored-by: FreneticScribbler <aj@aronajones.com>
* Upgrade to heroku-20 stack
* Move some gulp deps to dev rather than prod
* npm upgrade
* Fix audit time check in asset audit test
* Attempt at parallelising tests where possible
* Add basic calendar button test
Mainly to pickup on FullCalendar loading errors
* Upgrade python deps
* Tends to help if I push valid yaml
* You valid now?
* Fix whoops in requirements.txt
* Change python ver
* Define service in coveralls task
* Run parallelised RIGS tests as one matrix job
* Update python version in tests
* Cache python dependencies
Should majorly speedup parallelillelelised testing
* Purge old vagrant config
* No Ruby compass bodge, no need for rubocop!
* Purge old .idea config
* Switch to gh-a artifact uploading instead of imgur 'hack'
For test failure screenshots. Happy now @mattysmith22? ;p
* Oops, remove unused import
* Exclude tests from the coverage stats
Seems to be artifically deflating our stats
* Refactor asset audit tests with better selectors
Also fixed a silly title error with the modal
* Add title checking to the slightly insane assets test
* Fix unauth test to not just immediately pass out
* Upload failure screenshots as individual artifacts not a zip
Turns out I can't unzip things from my phone, which is a pain
* Should fix asset test on CI
* What about this?
* What about this?
Swear I spend my life jiggerypokerying the damn test suite...
* Does this help the coverage be less weird?
* Revert "Does this help the coverage be less weird?"
This reverts commit 39ab9df836.
* Use pytest as our test runner for better parallelism
Also rewrote some asset tests to be in the pytest style. May do some more. Some warnings cleaned up in the process.
* Bah, codestyle
* Oops, remove obsolete if check
* Fix screenshot uploading on CI (again)
* Try this way of parallel coverage
* Add codeclimate maintainability badge
* Remove some unused gulp dependencies
* Run asset building serverside
* Still helps if I commit valid YAML
* See below
* Different approach to CI dependencies
* Exclude node_modules from codestyle
* Does this work?
* Parallel parallel builds were giving me a headache, try this
* Update codeclimate settings, purge some config files
* Well the YAML was *syntactically* valid....
* Switch back to old coveralls method
* Fix codeclimate config, mark 2
* Attempt to bodge asset test
* Oops, again
Probably bedtime..
* Might fix heroku building
* Attempt #2 at fixing heroku
* Belt and braces approach to coverage
* Github, you need a Actions YAML validator!
* Might fix actions?
* Try ignoring some third party deprecation warnings
* Another go at making coverage show up
* Some template cleanup
* Minor python cleanup
* Import optimisation
* Revert "Minor python cleanup"
This reverts commit 6a4620a2e5.
* Add format arg to coverage command
* Ignore test directories from Heroku slug
* Maybe this works to purge deps postbuild
* Bunch of test refactoring
* Restore signals import, screw you import optimisation
* Further template refactoring
* Add support for running tests with geckodriver, do this on CI
* Screw you codestyle
* Disable firefox tests for now
That was way more errors than I expected
* Run cleanup script from the right location
* Plausibly fix tests
* Helps if I don't delete the pipeline folder prior to collectstatic
* Enable whitenoise
* Can I delete pipeline here?
* Allow seconds difference in assert_times_equal
* Disable codeclimate
* Remove not working rm command
* Maybe this fixes coverage?
* Try different coverage reporter
* Fix search_help to need login
* Made versioning magic a bit less expansive
We have more apps than I thought...
* Fix IDI0T error in Assets URLS
* Refactor 'no access to unauthed' test to cover all of PyRIGS
* Add RAs/Checklists to sample data generator
* Fix some HTML errors in templates
Which apparently only Django's HTML parser cares about, browsers DGAF...
* Port title test to project level
* Fix more HTML
* Fix cable type detail
* Start to seperate versioning into its own app
* Start reworking invoice things
* Reduced overall font size a touch
* Improvements to generic lists
* Tweak some colours to be a bit less OTT
I need to work out if I can seperate background and primary colours like BS3 did
* Improvements to event table mobile
* First pass at mobile-ising the generic list
* Item table fixes
* Fixed fullcalendar print css not included
* Asset list table improvements
* Tweak asset list to be more in line with other lists
* Versioning template improvements
//TODO Rather than have seperate asset templates, convert 'id' into a template variable
* Tweak versioning templates to allow ID overrides
Asset specific templates begone. Still need to bring back the ID formatting for the Rigboard.
* Asset form fixes
* Use the right autocompleter.js...
* Breakout (most) user stuff to separate module
The model remains in RIGS for now, as it's pretty painful to move...
* Python Format/import opt
* Test Refactor Part 1 - Shuffle things around
* Fix migrations
TODO - need to ensure moved models are *moved* rather than deleted and recreated!
* Start on new tests
* Initial work on event create test reimpl
* Init other tests, more rigs test faffery
* Desaturate theme colors even more
Much closer to BS3
* Fix event item adding
Bit too heavy handed with the deduplication there Arona
* Initial refactor of event item testing
* Upgrade bootstrap-select
* Updated bootstrap-select for BS4
* Initial port of duplicate testing
Needs the latter half rewriting once we have an EventDetail POM
* Refactor date validation test
So close to killing test_functional.EventTest!
* Deduplication of testing code
* pep8
* Fix some tests
And some things that were actually borked
* FIX: Prevent setting access time after start time
Cherry pick of d274ea4606. Will close#405.
* Refactor calendar tests
* FIX: Don't show asset buttons/history for basic users
* Really ought to get a pre-commit hook for pep8...
* Fully replace test_functional
* Dedupe generic search logic
* Fix the remaining tests
* Ensure submit button is scrolled to in tests
* Fix asset creation test + actually verify its results
* Make CI use latest (stable) chromedriver rather than some ancient one
Since Travis uses the latest stable chrome, should always match. Bash oneliner \o/
* Of course | is part of YAML syntax, of course...
Maybe this works.
* Update python version
Trying to get CI to match my local environment as much as possible...
* Minor test futzing
* Well that wasn't clever of me
* That was even less clever of me
* Revert to old submit wait behaviour
* What about if I did this
* Try disabling chrome cache
* Added screenshot recording of test failures
* Fixed RIGS tests not being run
* Fixed Pep8 - I promise I'll make a pre-commit hook sometime!
* Very initial work at togglable darktheme.
Dammit @alexdaniel654 just when I had my scope creep kinda under control. It'll be v. nice to have though...!
* More dark theme wangling
* Fix some asset template things
* FIX: CI Locale Issues
* Fix sample command
* Initial work at integrating the risk assessment
#136. No clever database structure as yet...
* FIX: Don't set every boolean input to radios
* Different approach to RA linking
* Move text definitions to somewhere more authoratitive
* FIX: Undo breakage causing autopep8
o.O
* Expand detail template
* Use correct view for RA history
* Initial work at coercing activity feed into showing RAs
Also shows Asset/Supplier on the homepage feed.
* Refactor activity feed template logic
Yay for removing arbitrary if/else chains!
* Initial work on caching activity feed
Server side that is. Ref #162.
* Start RA list template
* Refactor RA creation stuff, again
* Add H&S Details to Event Detail View
* Display venue notes in event detail
Notes are no use if nobody reads them. Not sure on this one.
* Add ability to filter event archive by status
Closes#168.
* Fix lingering naive time
* Use locmem cache in sqlite environments
Otherwise the tests just lock up totally. Should close#162
* Update dependencies
Mirrors/supersedes 0e67da82e2
* Add global ctrl/meta-enter shortcut for form submission
Wants rewriting for better efficiency, but hey, it works!
* Update dependencies
* Fix for a situation that should be impossible
* Fix navbar alignment
* FEAT: Improve 'omni'search
- Partialised template
- Added to assets header
- Added ability to search assets/suppliers
- Improved selection logic
- Have it display current query
* Move closemodal into PyRIGS
* Fix tests for search improvements
* Dark mode colour improvements
* Fix table colors for dry hires
* further darktheme fixes
* Remove the dark header from light theme
* Fix reload loops when CSS/JS is changed
* Move dark theme SCSS to separate file, fix inactive pagination styling
* Genercise detail pages
* Testing something re notes
I wonder if I can make that global, rather than per-template...
* Dark theme palette shenanigans
I just can't decide
* Match darktheme palette to forum darktheme palette
Why reinvent the wheel.
* Make supplier detail use the generic template
* Disable mobile event table PoC for now
* Remove the defaults from the RA fields + make them required
* More RA fixes
* Fixes to revisions for RAs
* Add bootstrap 4 test page
* Bunch of dark mode fixes from test page
* Do not use Django 'required' for radio selects
As this requires them to be True, whereas we just need to require that an option be entered.
* Properly fixed popover darktheme
* Fixed search for events
* Style fixes to asset list
* Start RA 'mark review' feature
* Add reviewing to revision history, fix RA editing not working
Also actually commit all the files, that helps
* Fix Power MIC being lost on RA edit
Why it is subtly different to the Event Update behaviour? Who knows
* Invalidate RA review if it is edited after review
* Start work on event checklist
* Add a button for creating and instantly voiding invoices
Handy dandy for when you have loads of cancelled events, like say, a pandemic
* Mooooore status chips, mooore
* Initial shenanigans on storing my overly fancy EC form
* Proof of concept for JSON parsing/storage
\o/
* Add new line functionality for vehicles/drivers
Might it have been easier to create 'dummy' models like with EventItems? Probably...
* Alter rig_count to not include un-checked-in dry hires
* Insert a divider between still-out dry hires and actually upcoming events on rigboard
* Initial work on new checklist handling. No more JSON!
* Versioning module now does magic
Automatic creation of views/urls for anything registered with reversion, with a small amount of hackage to preserve legacy stuff. (and the DAMNED asset IDs!) I would never get distracted...
* Cleanup
* Event checklist crew works
Mostly - its not happy with timezones
* Medium event power stuff done, barring worst case stuff
* Misc fixes
* Validation of power reqs
* Worst case points on checklist
* Templating improvements to RA/EC stuff
* Do event table color logic at python level
* Audit template fixes
* Restrict versioning to one level of depth for speed
Also fixed the template for nested changes
* Event properties internal/authorised always return a explicit boolean rather than sometimes None
* Use template filter for notes
* Fix list templates
TODO: Sensible place to define the 'expected answer' stuff.
* Fix cable table template
* Rethink rigboard color logic again
Also revert some broken stuff
* Test fixes
* Modify auth test so it doesn't try and test for external authorisations
Cause that's not a thing
* Why does this work
Bloody overzealous autoformatter...
* Formatting...
* Initial work on RA tests
* Pages/start of tests for EventChecklists
* Much better coverage of H&S things
* Cleanup & Squash migrations
* Fix wrong variable name in settings.py
* Fix broken invoice list template
* Add revision history to invoices/payments.
Also patches previously introduced reversion permissions hole.
Supersedes and closes#337.
* Various misc fixes
* Fix for my fix
* Curse youuuuu pep8
* Invoice template improvements
* Minor fixes
* More tweaks
* More fixes
* Major improvements/fixes to authorisation templates
* Add ability to mark event checklists as Large Event
This just disables the checks to allow the rest of it to be filled out for large events, though I expect paper forms may still be used...
* Remove database ID from generic list
* Put power threshold values in a collapse
* Use template filter for consistent removal of 'None links'
Plus cleaner template markup! More HTML-in-Python tho, which always feels a bit CSS-in-JS
* Tweak asset list markup
* Begin to change add buttons success -> primary
Also change search primary -> info to avoid clash
* Begin to improve event checklist on mobile
* Asset detail template improvements
* Fix#326 (again)
* Fix errors being squashed
* Fix rigboard validation tests
* Initial work on BS4 button templatetag
Newfeatureitis strikes again
* Allow multiple event checklists per event
TODO: Status chip now needs rethinking
* Minor event detail fixes
* Fix tests
* Rework button tag
* Mobile fixes for search
* Fix event checklist on mobile
* Redo light theme palette
* Switch rigboard new button to primary
* Kill off excess whitespace on rigboard
* Rigboard Timing display tweaks
* Fix tests
* Properly handle eventauthorisations in new versioning
It's not great, not terrible...
* Prevent creating duplicate revisions on event
Potential fix for #322 - I couldn't reproduce even before this change...
* Template improvements
* Minor test fixes
* Revert "Prevent creating duplicate revisions on event"
Apparently it was too strong at preventing dupes...
This reverts commit cce0ad0f9f.
# Conflicts:
# RIGS/models.py
* Better approach to generic list templates + other deduplication
* Also apply better approach to generic detail pages
* One of these days I'll remember to test BEFORE pushing...
* And now the same for generic forms
* Display tick/cross rather than true/false in boolean version diffs
* Upgrade dependencies
* Fixes fixes fixes
* Fix dependency hell
Probably
* Correct handling of spaces in paperwork filenames
Also normalises display of Invoice IDs. Partial fix for #391.
* Buggerit millennium hand and shrimp
Knew I was gonna forget to fix the tests
* FIX: Set duplicated event status to provisional
Closes#398.
Flip flop. Flip flop.
* Update polyfill for datetime-local
Bloody Firefox. We love to hate you. Proper CSS of the fill to come, SoonTM.
Closes#391
* Curses!
* Minor typo fixes
* Initial pass at soop-consult confirmation screen for RAs
* Fix migration
* Make venue/date editable on EC
For multi venue, multi day events
Defaults to date and venue set on the event. Also made power MIC default to that set in RA
* Clearer logic for RA inverted fields
* (probably) fix tests
* Give keyholders supplier edit perm
* Generic list only displays edit button if user has perm
* Same perm check for generic details
* H&S Details takes up free space on non-internal events
* Remove flash of content when loading new rig page
* First pass at clearer display of asset list filters
* Fix tests / default to headless tests
(fingers crossed)
* Fix autocompleter.js to properly disable edit links again
* Move status color logic back to template
Cause that somehow makes it work better??
* Display note icon on event detail page
* Fix caching
* Put rounded corners back where they belong
* Remove lingering use of 'page-header'
BS removed that style
* More search and replace for BS changes
Thought I'd got them all. Clearly not!
* Remove enforced linebreak on status chips
* Fix horizontal-ness on some forms
* Remove animation on prefers-reduced-motion/low referesh rate devices
Also normalises handling of asset list cable table & improves its use of space on large devices
* Make version changes badges more readable
* First pass at making the calendar less crap
* Fix event table success logic
Yay for copy paste fails >.>
* Use borders rather than block colors for coloured tables under darktheme
* First pass at porting calendar from FC V3 to V5
Two major versions and all they did was rename a bunch of names...TWICE.
* Rework version name method to avoid blank names on eventchecklist vehicles/crew
* Fix cable test
* Made radio button focus much more obvious on dark theme
* Implement Jerb's wording changes
* Fix one test, break another...
* Fix recent change stream list mutation issue
* FIX: Do not naively cache event table
Not that easy, it turns out. Duh.
* FEAT: Implement #413 show associated assets on cable type detail pg
Closes#413
* Allow H&S for non-events
* Update emergency contact number
* Improvements to profile detail page
* 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
* Test fixes
* Add space for power/rigging plans to be linked to RAs
* Start move of event size logic to RA from Ec
* Javascript required shenanigans for RA power
* More moving of event size logic
* Fixing tests for new logic etc
* Why does this work
Indeed, it may not
* FIX: Stupid typo in versioning.py
* Further minor fixes to versioning
* Add icons to H&S menu items
* Should fix calendar breaking in production
* Small alignment fix in asset list
* Squash migrations
Co-authored-by: Matthew Smith <psyms13@nottingham.ac.uk>
* WIP: Basic work on audit
* WIP: Audit modal works
Need to get the ID search working.
* WIP: Javascript shenanigans for asset audit search
It's not clean but it works..
* Improve audit search bar
Optimise for APM!
* Filter asset audit list by never-audited
* Added cable functionality to audit form
Also improved styling
* FIX: Revert partialising of asset search
* Various UX Improvements
Also rearranged asset detail/edit to be more space efficient
* FIX: Remove assets from to-be-audited table when audited
Previously required a page reload
* Improve sample data generator
Does reversion properly and sets colours for asset statuses
* FIX: Gracefully handle 404s in audit search
* FEAT: Add buttons for some common defaults on audit form
TODO: Partialise those fragments and add them to the edit/create forms too.
* FIX: Fix asset sample data command when run alone
* FEAT: More handy buttons
* FIX: Stop quickbuttons being tab-selected
If someone's tabbing through, they won't be needing the buttons...
* FIX: Hide asset detail buttons for basic users
* FIX: Migrations
* Start tests for audit
* Some deduplication for testing code
* Improve asset audit testing
* Remember to test the tests Arona
* Potentially make modal tests more consistent
* FIX?: Up WebDriverWait timeout for modal tests
* FIX?: What about this way...
* Remake migrations
* Fix README badges to point to right branch
While I'm here eh :P
* Use aware time in audit
* Fix migrations again
* Fix for my fix...
* Modify audit exclusions to properly prevent data loss
* pep eiiiiiight
* Move relevant fields and create migration to autogen cable types
* CRUD and ordering
* FIX: Prevent creating duplicate cable types
* FIX: pep8/remove debug print
* FIX: Meta migrations... :>
* FIX: Update tests to match new UX
* Move cabletype menu links into 'Assets' dropdown
* Fix migration
* Specify version of reportlab
Should fix CI - looks like I went a bit too ham-handed in my requirements.txt purge last time...
* [requires.io] dependency update
* Server starts...
Various things are broken, but it runs!
* [requires.io] dependency update
* [requires.io] dependency update
* [requires.io] dependency update
* FIX: Broken migrations
* FIX: Update auth framework
* FIX: Correct static use in templates
* FIX: Fix supplier sort
* FIX: Remaining tests
* Revert "Disable password reset as temporary fix to vulnerability (#396)"
This reverts commit e0c6a56263.
# Conflicts:
# RIGS/urls.py
* FIX: Fix broken newlining in PDFs
Introduced by a change in Django 2.1 'HTML rendered by form widgets no longer includes a closing slash on void elements, e.g. <br>. This is incompatible within XHTML, although some widgets already used aspects of HTML5 such as boolean attributes.'
* FIX: Fix some Django4 deprecation warnings
Why not...
* Refactor dependency file
Should now only include dependencies we actually use, not dependencies of dependencies and unused things
* Add newlines to the paperwork print test event
This will catch the error encountered in 79ec9214f9
* Swap to pycodestyle rather than pep8 in Travis
And eliminate W605 errors
* Bit too heavy handed with the dep purge there...
* Whoops, helps if one installs pycodestyle...
* FIX: Re-add overridden login view
* Better fix for previous commit
* FIX: Bloody smartquotes
Co-authored-by: requires.io <support@requires.io>
* Added search to person, venue, organisation and event archive
* Added search to invoice archive
* Added event search to homepage
* Tidy up event search logic and optimise
* Fixed merge issues
* Stopped 404 on failed search
* Set default ordering of people, organisations & venues to alphabetical (rather than order of addition to database)
* Added invoice search to home page (if you have permissions)
* Made invoice archive sort by reverse invoice date (rather than order added to database)
* Added search help page (very pretty)
* Made single search box for all search types
* FIX: Missing date field breaking archive view
* FEAT: Add omnisearch to header
Tis a bit broken on mobile at the moment...
* CHORE: Conform old code to pep8
* FIX: Select the event form, not the search one in tests!
* Revert "FEAT: Add omnisearch to header"
This reverts commit 6bcb242d6b because it caused MANY more problems than anticipated...
* FIX: Stop 404 on failed search, again
* FEAT: Basic testing of search
* Use a tooltip to help explain the UX
Obviously since it needs a tooltip it isn't brilliant UX but the best I can think of for now...
Co-authored-by: Tom Price <tom@codedinternet.com>
Co-authored-by: David Taylor <david@taylorhq.com>
Co-authored-by: Arona Jones <aj@aronajones.com>
* CHANGE: First pass at opening up RIGS #233
Whilst it makes it something of a misnomer, the intent is to make the 'view_event' perm a permission to view event details like client/price. I don't see the point in giving everyone 'view_event' and adding a new 'view_event_detail'...Open to arguments the other way.
* CHANGE: New user signups now require admin approval
Given that I intend to reveal much more data to new users this seems necessary...
* CHORE: Fix CI
* FIX: Legacy Profiles are now auto-approved correctly
* Add testing of approval mechanism
This fixes the other functional tests failing because the user cannot login without being approved.
* Superusers bypass approval check
This should fix the remainder of the tests
* Prevent unapproved users logging in through embeds
Test suite doing its job...!
* FIX: Require login on events and event embeds again
Little too far to the open side there Arona... Whooooooops!
* FIX: Use has_oembed decorator for events
* FIX: Re-prevent basic seeing reversion
This is to prevent financials/client data leaking when changed. Hopefully can show them a filtered version in future.
* FIX: Remove mitigation for #264
Someone quietly fixed it, it appears
* FEAT: Add admin email notif when an account is activated and awaiting approval
No async or time-since shenanigans yet!
* FIX: Whoops, undo accidental whitespace change
* FEAT: Add a fifteen min cooldown between emails to admins
Probably not the right way to go about it...but it does work!
TODO: How to handle cooldown-emailing shared mailbox addresses?
* FIX: Remove event modal history deadlink for basic users
Also removes some links on the RIGS homepage that will deadlink for them
* FIX: Wrong perms syntax for history pages
* CHORE: Squash migrations
* FIX: Use a setting for cooldown
* FIX: Minor code improvements
* Started POM and assets test
* FEAT: Adapt unit tests from RIGS to assets
* CHORE: pep8...
* Added Asset Create and Edit forms
* Add non-cable asset creation test
* CHORE: Frickin pep8...
* Add cable asset creation test
* Basic asset create validation testing
* Asset edit tests are here
A bit dodgy in places but par for the course for me :P
* Add access level tests
* Delete unused code
Much less effort way to increase coverage stats :D
* Add delete sample data test for completeness
Chasing that sweet 100% coverage...
* Add supplier list page + tests
Also fix the supplier page not being ordered alphabetically
* Helps if I add the migration...
* Add supplier create/edit tests
* Asset duplicate tests
Also fixed some random bugs
* Asset search tests
* 404 tests and test that everything requires authentication
* Test visibility of form errors
And fix supplier form not displaying errors correctly!
* Fix broken search test
Co-authored-by: Matthew Smith <mattysmith22@googlemail.com>
Squashed commit messages below:
Also...
FIX: Person selection workflow in tests now works
FIX: Properly test name requirement in rig creation
And removed the dirty workaround for wercker so that the test no longer passes when it shouldn't. Which led to this mess of attempted fixes, now squashed:
Fine. Hardball.
What about if we click the button a different way...
Disable whole chunk of the test that was previously getting skipped
Perhaps you'd like to pass now Travis
Temporarily disable the offending part of the test.
Something odd is going on...TBC.
Reorder some selenium commands to try and fix test only failing on CI.
Another attempt at a CI test fix
FIX: Should fix rig create test failing on CI
* FEAT: Add oembed for assets
Don't see the worth in doing supplier currently...we don't OEmbed Org/Venue etc after all...
* FIX Copy paste error ;D
* Fix embeds not actually working for unauthenticated users
This is why I should have written tests...
I prevented them from seeing the change stream, didn't prevent them seeing individual histories. This has to be done as otherwise it leaks financial information. If I can be arsed I'll come back to this and allow basic users to see a filtered version.
* FIX#388: Prevent assets losing supplier data on edit
* FEAT: Add associated assets to supplier detail view
* FIX: Tweak supplier list to make detail view accessible
* Potential fix for #380
No idea if it works because I can't reproduce locally. S/O Reckons it should... :P
* FEAT #386: Asset search searches serial number.
Pending addition of advanced search.
* FIX: Order asset categories/statuses alphabetically
Instead of by pk because that's silly.
* FEAT: Statuses can have a CSS class defined in the admin panel
This replaces the hardcoding of colours in the asset list.
* FIX: Squash migrations
* Fixed supplier not working on all the create asset template
* Refactored away "assets" property on "Supplier" by using "related_name" instead
Co-authored-by: Matthew Smith <mattysmith22@googlemail.com>
* FEAT: Initial work on revision history for assets
The revision history for individual items mostly works, though it shows database ID where it should show asset ID. Recent changes feed isn't yet done.
* FEAT: Initial implementation of asset activity stream
* CHORE: Fix pep8
* FIX: Asset history table 'branding'
* FIX: Individual asset version history is now correctly filtered
* FEAT: Make revision history for suppliers accessible
* CHORE: *sings* And a pep8 in a broken tree...
* Refactored out duplicated code from `AssetVersionHistory
* CHORE: pep8
And another random bit of wierd whitespace I found
Co-authored-by: Matthew Smith <mattysmith22@googlemail.com>
Closes#358
Fingers crossed this works I don't have the actual data locally... I know I'm making a mess but needs must.
I genuinely hate whoever decided prefixes were a good idea now.
* FIX: Remove misleading admin site title
* Moved across assets_id sorting to use proper numeric values. Also mofifies SQL command to find free asset IDs so that it works on postgres.
* Changed generateSampleAssetsData.py to include prefices on some cables.
* Fixed pep8
* Fixed missed migration
* Ensured hidden asset fields are completed on every database write
* CMULTI is a thing, and therefore a max prefix length of 5 cannot be a thing
This fixes keyholders being unable to see financials information or create assets. (Well, the latter needs anyone to be able to create assets before it is fully fixed)
Takes inspiration from, but does not use, django-reversion-compare. We do a lot of RIGS-specific stuff that requires a lot of hacking to get working nicely with django-reversion-compare. The main example of this is event-item “many-to-one” fields. The performance difference of my code compared to django-reversion-compare was found to be negligible.
Add forms, views, templates and URLs.
Remove created at in favour of the built in versioning as that's much more accurate.
Switch to a OneToOneField with EventAuthorisation -> event as a result of this.
Move validation from models to forms where it probably belongs.
Provide more descriptive errors.
Add success page for authorisation.
There is never any need to track the time as VAT rate hardly ever changes and will always do so at midnight. We were already assuming this anyway but it was generating loads of warnings/errors.
This will break your local VAT rate database if using sqlite, but it is tested with postgres and works fine.
Advise is now to always use HTTPS for libraries as somebody else manages the certificate it will always validate and it makes sure that a large target doesn't get subject to MITM attack.
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)
At this stage the project is very early on, and the main focus has been on getting a working system that can be tested and put into use ASAP due to the imminent failure of the existing system. Because of this, the documentation is still quite weak, but this should be fixed as time goes on.
# Apps
- PyRIGS: Base app, stores 'global' information
- RIGS: Rigboard stuff - event calendar etc
- assets: Database of our kit, testing data etc
- training: Logs in-house training within various "departments" (sound, lighting etc).
- versioning: Our custom logic built on top of django-reversion. Semi-modular.
- users: Our custom logic for registration and profiles. Semi-modular.
This document is intended to get you up and running, but if don't care about what I have to say, just clone the sodding repository and have a poke around with what's in it, but for GODS SAKE DO NOT PUSH WITHOUT TESTING.
### What is this repository for? ###
For the rapid development of the application for medium term deployment, the main branch is being used.
Once the application is deployed in a production environment, other branches should be used to properly stage edits and pushes of new features. 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. Mainly the C implementation of Python 2 (CPython 2) has been used (specifically the Python 2.7 standard). Most of the application has been written with Python 3 in mind however, and should run without issue. Some level of testing on Python 3 has been done, but there is no guarantee it will work (for more information on this please see [[Python Version]] on the wiki)
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.
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 <dir>
```
Where dir is the directory you wish to create the virtualenv in.
Next activate the virtualenv.
```
Windows
<virtualenv_dir>/Scripts/activate.bat
Unix
source <virtualenv_dir>/bin/activate
```
Finally install the requirements using pip
```
cd <pyrigs project directory>
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.
### Committing, pushing and testing ###
Feel free to commit as you wish, on your own branch. On my branch (master for development) do not commit code that you either know doesn't work or don't know works. If you must commit this code, please make sure you say in the commit message that it isn't working, and if you can why it isn't working. If and only if you absolutely must push, then please don't leave it as the HEAD for too long, it's not much to ask but when you are done just make sure you haven't broken the HEAD for the next person.
raiseforms.ValidationError(format_html("Are you sure about that? Your access time seems a bit optimistic. If you're sure, save again. <input type='hidden' id='warn-access' name='warn-access' value='0'/>"),code='access_sanity')
returnsuper().clean()
defsave(self,commit=True):
m=super(EventForm,self).save(commit=False)
m=super().save(commit=False)
if(commit):
m.save()
@@ -140,4 +128,123 @@ class EventForm(forms.ModelForm):
raiseforms.ValidationError(f"Your answers to these questions: <ul>{''.join([str(elem)foreleminunexpected_values])}</ul> require consulting with a supervisor.",code='unusual_answers')
returnsuper().clean()
classMeta:
model=models.RiskAssessment
fields='__all__'
exclude=['reviewed_at','reviewed_by']
classEventChecklistForm(forms.ModelForm):
def__init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
self.fields['date'].widget.format='%Y-%m-%d'
forname,fieldinself.fields.items():
iffield.__class__==forms.NullBooleanField:
# Only display yes/no to user, the 'none' is only ever set in the background
field.widget=forms.CheckboxInput()
related_models={
'venue':models.Venue,
}
classMeta:
model=models.EventChecklist
fields='__all__'
exclude=['reviewed_at','reviewed_by']
classPowerTestRecordForm(forms.ModelForm):
def__init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
forname,fieldinself.fields.items():
iffield.__class__==forms.NullBooleanField:
# Only display yes/no to user, the 'none' is only ever set in the background
field=models.CharField(error_messages={'unique':'A user with that username already exists.'},help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.',max_length=30,unique=True,validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$','Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')],verbose_name='username'),
field=models.CharField(error_messages={'unique':'A user with that username already exists.'},help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',max_length=150,unique=True,validators=[django.contrib.auth.validators.ASCIIUsernameValidator()],verbose_name='username'),
field=models.CharField(error_messages={'unique':'A user with that username already exists.'},help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',max_length=150,unique=True,validators=[django.contrib.auth.validators.UnicodeUsernameValidator()],verbose_name='username'),
('nonstandard_equipment',models.BooleanField(help_text="Does the event require any hired in equipment or use of equipment that is not covered by <a href='https://nottinghamtec.sharepoint.com/:f:/g/HealthAndSafety/Eo4xED_DrqFFsfYIjKzMZIIB6Gm_ZfR-a8l84RnzxtBjrA?e=Bf0Haw'>TEC's standard risk assessments and method statements?</a>")),
('nonstandard_use',models.BooleanField(help_text='Are TEC using their equipment in a way that is abnormal?<br><small>i.e. Not covered by TECs standard health and safety documentation</small>')),
('contractors',models.BooleanField(help_text='Are you using any external contractors?<br><small>i.e. Freelancers/Crewing Companies</small>')),
('other_companies',models.BooleanField(help_text='Are TEC working with any other companies on site?<br><small>e.g. TEC is providing the lighting while another company does sound</small>')),
('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?')),
('outside',models.BooleanField(help_text='Is the event outdoors?')),
('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)),
('power_plan',models.URLField(blank=True,help_text="Upload your power plan to the <a href='https://nottinghamtec.sharepoint.com/'>Sharepoint</a> and submit a link",null=True,validators=[RIGS.models.validate_url])),
('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 this venue new to you (the MIC) or new to TEC?')),
('safe_loading',models.BooleanField(help_text='Are there any issues preventing a safe load in or out? (e.g. sufficient lighting, flat, not in a crowded area etc.)')),
('safe_storage',models.BooleanField(help_text='Are there any problems with safe and secure equipment storage?')),
('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?')),
('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,help_text='Who are the persons on site responsible for their use?',null=True)),
('rigging_plan',models.URLField(blank=True,help_text="Upload your rigging plan to the <a href='https://nottinghamtec.sharepoint.com/'>Sharepoint</a> and submit a link",null=True,validators=[RIGS.models.validate_url])),
field=models.ForeignKey(blank=True,help_text='Who is the Power MIC? (if yes to the above question, this person <em>must</em> be a Power Technician or Power Supervisor)',null=True,on_delete=django.db.models.deletion.CASCADE,related_name='power_mic',to=settings.AUTH_USER_MODEL,verbose_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='checklists',to=settings.AUTH_USER_MODEL,verbose_name='Power MIC'),
field=models.TextField(blank=True,default='',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?'),
),
migrations.AlterField(
model_name='riskassessment',
name='persons_responsible_structures',
field=models.TextField(blank=True,default='',help_text='Who are the persons on site responsible for their use?'),
),
migrations.AlterField(
model_name='riskassessment',
name='power_notes',
field=models.TextField(blank=True,default='',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?'),
),
migrations.AlterField(
model_name='riskassessment',
name='power_plan',
field=models.URLField(blank=True,default='',help_text="Upload your power plan to the <a href='https://nottinghamtec.sharepoint.com/'>Sharepoint</a> and submit a link",validators=[RIGS.models.validate_url]),
),
migrations.AlterField(
model_name='riskassessment',
name='rigging_plan',
field=models.URLField(blank=True,default='',help_text="Upload your rigging plan to the <a href='https://nottinghamtec.sharepoint.com/'>Sharepoint</a> and submit a link",validators=[RIGS.models.validate_url]),
),
migrations.AlterField(
model_name='riskassessment',
name='sound_notes',
field=models.TextField(blank=True,default='',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?'),
field=models.ForeignKey(blank=True,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'),
field=models.BooleanField(default=False,help_text='Are there additional requirements for parking and access to the venue? (i.e. campus parking permits, event access wristbands)'),
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.