Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explitictly unset prioritize on deprioritizing #531

Closed
wants to merge 1 commit into from

Conversation

mark-boute
Copy link
Collaborator

@mark-boute mark-boute commented Dec 13, 2023

closes #525
Make sure that the prioritize flag is unset on de-prioritizing.

@mark-boute
Copy link
Collaborator Author

@KiOui any idea why this is not unsetting the flag currently? I am stuck

@mark-boute mark-boute linked an issue Dec 13, 2023 that may be closed by this pull request
@KiOui
Copy link
Owner

KiOui commented Dec 13, 2023

@KiOui any idea why this is not unsetting the flag currently? I am stuck

The OrderSerializer has the prioritize field as read-only. It should be altered in such a way that deprioritize overrules prioritize. I think we have three options here:

  • The best option is to just create a new field "priority" with three options: "deprioritize", "normal" or "prioritize". This option does however require a database migration and some other adjustments. It's however better than what we use now as having prioritize and deprioritize both true is a weird situation.
  • We could also maybe adjust the save method to automatically set prioritize to false whenever deprioritize is true.
  • Or we could change the OrderSerializer to also accept the prioritize field and then adjust the OrderRetrieveUpdateDestroyAPIView such that it only accepts changes to the prioritize field if the user has permission.

@KiOui KiOui added the bug Something isn't working. label Dec 13, 2023
@JobDoesburg
Copy link
Collaborator

For me, this is a frontend thingy. There's nothing wrong with both prioritize and deprioritize flags set in principle. It's just not the behavior people expect if they hit the button. So keep it in the API / serializer

@KiOui
Copy link
Owner

KiOui commented Dec 14, 2023

I don't agree with you on that point. It's weird to have an order that both has priority and does not have priority. So I think migrating this to just one field that can either be prioritized, normal or deprioritized is the best option.

@KiOui
Copy link
Owner

KiOui commented Dec 24, 2023

This has been fixed in #534

@KiOui KiOui closed this Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prioritise/deprioritise conflict
3 participants