-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix submission status #354
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got some concerns around this. We shouldn't be publishing when saving a revision, since that means you can't have anything in draft. We also shouldn't be overwriting revision history, we'll want to be able to see in the history the templates that failed submission.
Also, are there not any unit tests around this? Shouldn't we be adding checks that this submission is updating all the fields that we expect it to?
r.content["submission_name"] = self.template_name | ||
r.content["submission_status"] = self.submission_status | ||
r.content["submission_result"] = self.submission_result | ||
r.save() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be overwriting the whole history of a template whenever we create a submission.
If I'm understanding correctly, the reason the updated status doesn't appear in the list, is that the list only shows the latest published value, not the latest revision. In that case, simply adding the publishing should've fixed this (although publishing on save also doesn't seem correct to me)
Purpose
There is a bug on the submissions status fields on standalone templates, where the submissions status fields that show on the listing page, is not always the same as on the edit page.
This is due to revisions, and the listing page only showing published revisions, whereas the edit page shows the latest, regardless of live/draft status,
Solution
To fix this for now, we overwrite the submission status of all revisions, with the information of the last submission attempt