-
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
Feature/extra attachments #743
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.
Nice work overall! Some clever stuff here. I did find one crazy bug, but the fix is super simple, so, granted you fix this, I approve :)
@@ -22,6 +28,12 @@ <h3> | |||
{% for slot in slots %} | |||
{% include slot with manager=manager %} | |||
{% endfor %} | |||
<p class="text-center"> | |||
<a href="{% url "proposals:attach_study" proposal.pk %}">Voeg extra bestand toe |
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.
The kwarg should be study.pk. Leads to a bug otherwise.
This branch allows for the adding for extra attachments to a proposal and its studies.
An additional change to this branch is that we now allow changing the kind ("Type") of an attachment in the attachment update views.
Earlier I thought it would make sense to always enforce the kind if it was set by a slot. Now, when implementing extra files this felt like an overreach which would require deleting and re-adding of files by the user if they ever wanted to change the type.
Changing the type of a required attachment will simply move it from the required to an extra slot, as the attachment no longer fulfills the requirements for the required slot. Only if you are adding a new attachment to a required slot will the kind be enforced by the view.
I recommend taking a look at the changes to
Stepper.attachment_slots()
, which is now a property that matches slots on the fly. Slots generated by checkers now live inStepper._attachment_slots
, but that change should be of no consequence as long as theStepper.add_slot()
method is used.