openlibhums / openlibhums/janeway
Clear up unneeded saves after adding M2M links
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 238
- Forks
- 97
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
Django's add method for creating many-to-many relations typically does not require calling save to prompt a database-level change, in contrast to most other changes to objects.
However, we often call save after many-to-many changes:
Describe the solution you'd like
Find all these and remove them if they can be removed.
Describe alternatives you've considered
Leaving them on the off chance they are needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the cited calls in src/journal/logic.py, src/identifiers/logic.py, src/journal/views.py, and src/submission/forms.py, then search for other many-to-many additions followed by save calls. Check the surrounding model and form behavior and run the relevant tests. Done means unnecessary saves are removed without changing database updates or existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, database
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100