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

Feature/extra attachments #743

Merged
merged 15 commits into from
Nov 12, 2024
Merged

Conversation

miggol
Copy link
Contributor

@miggol miggol commented Nov 5, 2024

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 in Stepper._attachment_slots, but that change should be of no consequence as long as the Stepper.add_slot() method is used.

Copy link
Contributor

@EdoStorm96 EdoStorm96 left a 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
Copy link
Contributor

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.

@miggol miggol merged commit 03d1828 into feature/attachments-4 Nov 12, 2024
1 of 3 checks passed
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