-
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
Changes from 4 commits
6cdfacb
667860e
53bfe72
c3c459e
7ef30ec
75ab28a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 3.2.20 on 2023-11-15 10:56 | ||
|
||
from django.db import migrations, models | ||
import proposals.validators | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('proposals', '0049_alter_proposal_supervisor'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='proposal', | ||
name='avg_understood', | ||
field=models.BooleanField(blank=True, default=None, null=True, validators=[proposals.validators.AVGUnderstoodValidator], verbose_name='Ik heb mijn aanvraag en de documenten voor deelnemers besproken met de privacy officer.'), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,7 @@ | |
{% blocktrans with title=proposal.title reference_number=proposal.reference_number submitter=proposal.created_by.get_full_name trimmed %} | ||
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 commentThe 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 |
||
{% if proposal.is_revision %} | ||
<br> | ||
<strong> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,11 @@ def __call__(self, value): | |
|
||
|
||
def AVGUnderstoodValidator(value): | ||
|
||
if value != True: | ||
# 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 commentThe 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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 3.2.20 on 2023-11-14 09:46 | ||
|
||
from django.db import migrations, models | ||
|
||
def update_is_commssion_review(apps, schema_editor): | ||
|
||
Review = apps.get_model('reviews', 'Review') | ||
|
||
for review in Review.objects.all(): | ||
#Hardcoded this to account for possible future changes to stages | ||
SUPERVISOR_STAGE = 0 | ||
if review.stage == SUPERVISOR_STAGE: | ||
review.is_commission_review = False | ||
review.save() | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('reviews', '0012_auto_20211213_1503'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='review', | ||
name='is_commission_review', | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.RunPython(update_is_commssion_review), | ||
] |
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 ;)