Invent API endpoints and CLI subcommands to manipulate the classlist

Everything works, and the names should be self-explanatory:

  • plom-cli delete-classlist -- no parameters, friendly 1-line confirmation on success
  • plom-cli download-classlist -- writes the classlist to stdout
  • plom-cli upload-classlist -- extends server's classlist with names from a CSV file

Note that upstream services already did this "extend" thing with new uploads. (The alternative would have been to replace the classlist with the new one.) But that was a bit fraught: a new upload that included colliding student ID's would add stuff to the database until the collision was noticed and the exception was raised, leaving the database's contents a little unpredictable. Now we check that the upload will produce no collisions in advance. Sorry about the "ask-permission" approach, but Vlad the Validator was already at the party when I arrived.

Edited by Philip Loewen

Merge request reports

Loading