-
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/4 small issues #579
Conversation
Ok, so I decided to also incorporate a fix for #491 here. I hope this PR is not getting too messy for you both ... 491: I did run into one issue here ... The |
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.
Right off the bat, I see that there's a new way to differentiate supervisor reviews (yay) but that we still don't differentiate between open and closed supervisor reviews. Could you add that functionality, such that concluded supervisor reviews are given the stage review.CLOSED
? This logic lives in Review.update_go()
currently.
I wanted to bring that up right away, because closing those reviews might bring up more required changes, and would also require changes to the data migration to close all old supervisor reviews.
I only had time to look at the #350 part of this PR so far. I will review this further at a later time.
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.
Fully agree with Michael's notes about #350, the whole point was to be able to close those reviews as well. (The issue was created because of a different issue partly caused by supervisors reviews never closing).
I did take a look at the other issues. The fix for #575 is a automatic approve ;)
I do have comments for the others
FETC-GW - <em>{{ title }}</em> (referentienummer {{ reference_number }}, ingediend door {{ submitter }}) | ||
{% endblocktrans %} | ||
- {% trans proposal.reviewing_committee.name %} |
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.
IIRC Desiree wanted it to be part of the refnum. (Which we do actually in other places too)
It's fine if the committee name isn't translated; user's never get the refnum format anyway
proposals/validators.py
Outdated
# This does not seem to do anything, so I removed it from the model, however, | ||
# if I try to remove this validator entirely I get an error when making | ||
# migrations? | ||
if value is None: | ||
raise forms.ValidationError( | ||
_('Je dient kennis genomen te hebben van de AVG om jouw aanvraag in ' | ||
_('Je dient deze vraag in te vullen om jouw aanvraag in ' | ||
'te dienen'), code='avg' | ||
) |
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 cannot reproduce your issue. Disabling your form validation works reliably. I did even test by changing the rule to fail on False and True to see if that works.
proposals/models.py
Outdated
avg_understood = models.BooleanField( | ||
_('Ik heb kennis genomen van het bovenstaande en begrijp mijn verantwoordelijkheden ten opzichte van de AVG.'), | ||
default=False, | ||
null=False, | ||
_('Ik heb mijn aanvraag en de documenten voor deelnemers besproken met de privacy officer.'), | ||
default=None, | ||
null=True, | ||
blank=True, | ||
validators=[AVGUnderstoodValidator], | ||
) |
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'm not sure if changing the label/help text of an existing, different question, is the way to go here. You're effectively rewriting history a bit.
It's less of a problem now that we have canonical PDF, as the record will not change (and thus, the proper history is preserved).
However, there are still two issues;
From a developer view, the variable name is confusing now.
From an applicants view, upon revision/copy/amendment we're going to fill in 'yes' to all existing proposals for this question. (As it was required to be true before). This is less than ideal, as ideally we want to force applicants to re-evaluate if they actually did/need to contact the privacy officer.
I'd remove the whole field and add another; that should also fix your migration error ;)
One last thing: you only added the |
Ok, so I implemented the changes you both requested, some notes:
|
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.
Some minor tweaks, and it should be good to go :)
@@ -11,6 +11,7 @@ def update_is_commssion_review(apps, schema_editor): | |||
SUPERVISOR_STAGE = 0 | |||
if review.stage == SUPERVISOR_STAGE: | |||
review.is_commission_review = False | |||
review.update_go() |
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.
In theory this should work... However, the production DB isn't as clean as we would like.
I'd feel better if the code was something like this:
if review.go:
review.stage = CLOSED
It's a lot simpler, and should be safer.
@@ -90,7 +90,7 @@ <h3> | |||
</em> | |||
</li> | |||
{% endif %} | |||
{% if review.stage == review.SUPERVISOR %} | |||
{% if review.is_commission_review == False %} |
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.
It's cleaner to write {% if not review.is_commission_review %}
reviews/views.py
Outdated
@@ -556,7 +556,7 @@ def form_valid(self, form): | |||
|
|||
# Don't notify the secretary if this is a supervisor decision. | |||
# If it was a GO they the secretary will be notified anyway | |||
if not review.stage == review.SUPERVISOR: | |||
if review.is_commission_review == True: |
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.
== True
is redundant
{% blocktrans with title=proposal.title reference_number=proposal.reference_number submitter=proposal.created_by.get_full_name reviewing_committee=proposal.reviewing_committee.name trimmed %} | ||
FETC-GW - <em>{{ title }}</em> (referentienummer {{ reference_number }}-{{reviewing_committee}}, ingediend door {{ submitter }}) |
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.
Hate to be that guy... But conventionally we place the committee before the rest of the refnum.
Sorry, should've clarified that in my original comment
All right, so I've implemented Ty's minor tweaks, but, more importantly, I realized that it should be |
This PR fixes #350, #575 and #578.
350: This was the biggest one. I added an
is_commission_review
field to theReview
model, so that there is a simple check to see if a review is a supervisor review, besides the stage. Some things to note:True
, only get changed when creating a supervisor review.575: Just make sure the supervisor's name, instead of solisID is displayed on the review detail page.
578: Added Chamber information to the PDF header. Right now, just using the acronyms, as this was requested by Desiree. It now looks like this, at the top of the page:
'FEtC-H - Looking at the elderly_rev (reference number 23-019-01, submitted by Justin Bieber) - LC'
The code in the template is a bit ugly ... I was kindoff struggling with keeping the chamber name translatable, but IMO this is fine.