Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix testing Rule query before saving
When creating a new Rule and testing its query before saving it, an error like this was happening: 'Rule' instance needs to have a primary key value before this relationship can be used. From the user's perspective, the test was not happening and the server returned a 500 error. When testing a new Rule that has not been saved, a temporary Rule object is created in memory. Since that object is not saved, it does not contain a primary key. Due to some changes introduced in Django 4, errors are thrown if that object without a primary key is used. To fix that issue, we manually assign a primary key.
- Loading branch information