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

Add more mod actions (always set status, depublish attachments) #865

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pajowu
Copy link
Member

@pajowu pajowu commented Oct 8, 2024

  • 🚸 Always allow mods to change request status
  • ✨ Allow mods to depublish attachments

@pajowu pajowu requested review from krmax44 and stefanw October 8, 2024 16:11
@pajowu pajowu changed the title Add more mod actions (always set status, depublish attachments" Add more mod actions (always set status, depublish attachments) Oct 8, 2024
@pajowu
Copy link
Member Author

pajowu commented Oct 9, 2024

The publish_document task exists early if the document is still pending (not changing the public value of the document). This could lead to some weird behaviour if the document is not yet fully processed, but depublished in the meantime. I'm not sure what the best solution here is. Should we change the task to retry later or just accept it, as this should hopefully not happen?

Click fires before the value is changed, which leads to weird behaviour
@krmax44
Copy link
Member

krmax44 commented Oct 10, 2024

The publish_document task exists early if the document is still pending (not changing the public value of the document). This could lead to some weird behaviour if the document is not yet fully processed, but depublished in the meantime. I'm not sure what the best solution here is. Should we change the task to retry later or just accept it, as this should hopefully not happen?

Not quite sure if I understand correctly. The publish_document task checks if the document is currently processing: https://github.com/okfde/django-filingcabinet/blob/3b1dc92d89da48af9851e37a22ac1310922b9c73/src/filingcabinet/tasks.py#L49-L50

@pajowu
Copy link
Member Author

pajowu commented Oct 10, 2024

Yes exactly. In this case, the tasks just does nothing. If someone creates a document from an attachment and then shortly after that depublishes the attachment (while the document is still processing), the approved-field of the attachment would be set to False, but the document would not be set to private. This would lead to a public document for a non-public attachment

@krmax44
Copy link
Member

krmax44 commented Oct 10, 2024

Ah, I see. Maybe we could use Celery's task linking to run the publishing/depublishing task after the processing task (if a processing task exists)?

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.

2 participants