-
Notifications
You must be signed in to change notification settings - Fork 12
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
Edit a verification request #508
Conversation
e18c830
to
7025854
Compare
hi @tortila thanks for taking me through this on the call just now - I feel like I have a good understanding of the changes now, and the last few bits before we merge it in. Have a nice week away :) |
6d4d2d9
to
e50a9ee
Compare
a75a88f
to
a7aa367
Compare
…nstance for editing
…with additional fields
…uest do not exist
…in the as_view method in urls
a7aa367
to
926b589
Compare
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.
Oliwia and I reviewed this code synchronously on a video call, and again in person. I'm happy to merge this in.
This PR aims to enable editing of submitted verification requests by their authors, using the same multi-step wizard form.
Scope of changes:
/requests/{id}/edit
which is only accessible for admins and authors, and only when the request is open. We re-use the same WizardView but this time pass aninstance_dict
as an argument, which contains model instances as expected by consecutive steps.ModelForm
orModelFormSet
s. This allows to inject either aninstance
ofqueryset
with existing objects and delegate handling the updating/deletion of objects to Django magic.MultiModelForm
s andConvenientFormSet
s for the whole machinery to work properly (all workarounds documented in the code with examples).ProviderRequest
object will mark its status to OPEN.ProviderRequest
model and not a separate one. Added a relevant migration and changed the model forms.display :none
. This is a workaround so that evidence rows can be deleted, this didn't work before because the flexbox overrides the "hidden" attribute behavior.test_editing_pr_updates_original_submission
which covers an end-to-end journey of updating a verification requests.Out of scope:
After merging:
Remember to run the migrations!