Submitted to Auto-Approve
- Dominant language
- Python
- Stars
- 12
- Forks
- 21
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 5
Description
# TL;DR
Classically, Lookit has always reverted the state of a study to `rejected` when any aspect of it has changed. Moving forward, we'd like to be able to conditionally move the state to `autoaccept` when non-essential fields are updated.
# Narrative
There appears to be two solutions:
1. Currently, Lookit doesn't have a pattern to handle conditional state changes. Thankfully, the library we're using does have [this functionality available](https://github.com/pytransitions/transitions#conditional-transitions). We should update this library to the current stable version and implement a solution to handle a conditional change on a few fields. _(These fields have yet to be determined.)_
1. Another consideration would be tracking field changes. Lookit does have [a pattern is this space](https://github.com/lookit/lookit-api/blob/develop/studies/models.py#L842). Extending this solution to cover our needs for this issue could be done.
Additionally, this state change will need to be viewable in the Study Details Log.
# Acceptance Criteria
A precise description of how/when this issue will be considered closed, e.g.:
- [ ] Tests for conditional state change.
- [ ] UI Show autoaccept in logs
Contributor guide
Research direction
Start by reading the state-change handling in studies/models.py around line 842 and the transitions library's conditional-transition documentation. Determine which fields are non-essential before choosing an approach, then add tests for the conditional state change and update the Study Details Log so autoaccept changes are visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100