Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to volunteer import script #219

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

struan
Copy link
Member

@struan struan commented Jan 15, 2025

This updates the volunteer import script to make it yet more flexible.

Adds the following:

  • a --dry_run option which runs everything inside a transaction and then rolls it back so you can get the full report of what it would do without changing the DB. Mostly to allow checking if it's going to assign everything required
  • a --council_restrictions option which indicates there is a column in the import data with details of council restrictions for some volunteers
  • a --section_count_in_data which indicates that the number of councils to assign to volunteers is contained in a column in the import data.

Fixes #207

@struan struan force-pushed the 207-ceuk-volunteer-import-improvements branch 3 times, most recently from 4308d05 to 1b61f4f Compare January 20, 2025 09:29
This adds the following features:
* a dry run mode to allow seeing what the end result will be without
  updating the database
* a debug more which has diagnotstic information about how many
  assignments are being made to each user
* an option to read assignment counts from the import file
* an option to read preferred assignment council types (country or LBO
  only at the moment) from the import file

It also will not assign Audit users to councils they marked as part of
the First Mark.

add dry_run option to volunteer import script

Update the script to run all changes inside a transaction and if the
dry_run option is passed then rollback all changes.
This lets you see any issues with running out of assignments without
having made any changes to the database.

enable reading assignment counts from the import data

allow volunteer import data to have council restrictions

so you can limit people to e.g. Welsh councils.

allow superusers and ceuk staff to have existing assignments

Mostly to account for them having multuple rows in the same spreadsheet

for non First Mark assignments do not assign to council already assigned

This is mostly for the Audit stage where users should not be auditing
their own work

use response type in volunteer import where required

add more bad section names to section name map

add debug option so can output more verbose info

change restricted councils to be councils to select from first
@struan struan force-pushed the 207-ceuk-volunteer-import-improvements branch from 1b61f4f to 57a39f4 Compare January 20, 2025 10:06
@struan struan merged commit 57a39f4 into main Jan 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve volunteer import script to handle balancing assignments better
1 participant