Add multi-department support for photo submission #303
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Ready for review
Description of Changes
This PR extends initial multi-department support:
Testing
No errors should appear.
If you want to verify that images are linked to the right department, you can always do the following in
python manage.py shell
:Now add a few departments via the "Departments" menu and then go to "Submit Photos" to select a department and submit some test photos (note this does not work in a development environment because a S3 bucket needs to be hooked up, so you'll either need to hook up S3 to test or just run this on staging). See the gif for how to do this.
We do not have unit test coverage of the
/upload
route, so to verify the proper metadata was added in the database you can usepython manage.py shell
, for example:Since I selected Berkeley (which has
department_id = 2
), the result here matches my expectation.Tests and linting
I have rebased my changes on current
develop
pytests pass in the development environment on my local machine
flake8
checks pass