Skip to content

Conversation

@kdudka
Copy link
Contributor

@kdudka kdudka commented Mar 27, 2025

See the individual commit messages for details.

kdudka added 2 commits March 27, 2025 13:05
... to keep the nomenclature consistent with the `CANCELED` state.

Related: release-engineering#271
... to eliminate the following failure while applying migrations:
```
+ osh/hub/manage.py migrate
SystemCheckError: System check identified some issues:

ERRORS:
hub.Task.cancelled_by: (fields.E304) Reverse accessor 'User.task_set' for 'hub.Task.cancelled_by' clashes with reverse accessor for 'hub.Task.owner'.
	HINT: Add or change a related_name argument to the definition for 'hub.Task.cancelled_by' or 'hub.Task.owner'.
hub.Task.owner: (fields.E304) Reverse accessor 'User.task_set' for 'hub.Task.owner' clashes with reverse accessor for 'hub.Task.cancelled_by'.
	HINT: Add or change a related_name argument to the definition for 'hub.Task.owner' or 'hub.Task.cancelled_by'.
```

Related: release-engineering#271
Related: openscanhub/openscanhub#317
Closes: release-engineering#273
@kdudka
Copy link
Contributor Author

kdudka commented Mar 27, 2025

I have verified that the proposed changes fix the OpenScanHub CI: https://github.com/openscanhub/openscanhub/actions/runs/14106246494?pr=317

@amcmahon-rh
Copy link
Contributor

amcmahon-rh commented Mar 27, 2025

Hi Kamil, looks like I was a little too slow. I arrived at mostly the same fix and verified it on a fork of OpenScanHub too.

The main difference is I set the related_name to "+" which according to the Django docs tells it not to set up a backwards relation. Either will do the job though.

Edit: on reflection, I think it'll be better to go with the name you've added rather than "+". It'll keep the related_name values in the Task class consistent.

@kdudka
Copy link
Contributor Author

kdudka commented Mar 27, 2025

@amcmahon-rh Thank you for looking into this! I am fine with both the variants. Please let me know if you prefer the + one.

@amcmahon-rh
Copy link
Contributor

Lets go with your version. It'll be more consistent and avoid potential confusion down the line.

@kdudka
Copy link
Contributor Author

kdudka commented Mar 28, 2025

Thank you both for review! Could you please merge this? I do not have write access myself.

@amcmahon-rh amcmahon-rh merged commit d890be7 into release-engineering:master Mar 31, 2025
19 checks passed
@kdudka kdudka deleted the canceled-by-fixup branch March 31, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants