Skip to content

Commit

Permalink
style: steez
Browse files Browse the repository at this point in the history
  • Loading branch information
EdoStorm96 committed Sep 25, 2024
1 parent 33be1ae commit 712270f
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 34 deletions.
6 changes: 2 additions & 4 deletions proposals/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def __init__(self, *args, **kwargs):
for field in self.base_fields:
self.fields[field].empty_label = None
self.fields[field].choices = YesNoDoubt.choices

def clean(self):
"""
Check for conditional requirements:
Expand All @@ -897,9 +897,7 @@ def clean(self):
"""
cleaned_data = super(KnowledgeSecurityForm, self).clean()

self.mark_soft_required(
cleaned_data, "knowledge_security", "researcher_risk"
)
self.mark_soft_required(cleaned_data, "knowledge_security", "researcher_risk")

for field in self.base_fields:
self.check_dependency_list(
Expand Down
7 changes: 3 additions & 4 deletions proposals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ class PracticeReasons(models.IntegerChoices):
help_text=mark_safe_lazy(
_(
"Kennisveiligheid gaat over het tijdig signaleren en mitigeren "
"van veiligheidsrisico's bij wetenschappelijk onderzoek. Klik "
"<a href='https://intranet.uu.nl/kennisbank/kennisveiligheid'>hier</a> "
"voor meer informatie."
"van veiligheidsrisico's bij wetenschappelijk onderzoek. Klik "
"<a href='https://intranet.uu.nl/kennisbank/kennisveiligheid'>hier</a> "
"voor meer informatie."
)
),
max_length=1,
Expand Down Expand Up @@ -534,7 +534,6 @@ class PracticeReasons(models.IntegerChoices):
_("Licht toe"), max_length=200, blank=True
)


# References to other models
relation = models.ForeignKey(
Relation,
Expand Down
3 changes: 1 addition & 2 deletions proposals/templates/proposals/knowledge_security_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
{% trans "Afronding trajecten" %} - {{ block.super }}
{% endblock %}


{% block html_head %}
{{ block.super }}
<script>
Expand All @@ -20,4 +19,4 @@

{% block pre-form-text %}
<h3>{% trans "Afronding trajecten" %}</h3>
{% endblock %}
{% endblock %}
6 changes: 5 additions & 1 deletion proposals/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@
),
path("confirm/<int:pk>/", ProposalConfirmation.as_view(), name="confirmation"),
path("study_start/<int:pk>/", StudyStart.as_view(), name="study_start"),
path("knowledge_security/<int:pk>/", ProposalKnowledgeSecurity.as_view(), name="knowledge_security"),
path(
"knowledge_security/<int:pk>/",
ProposalKnowledgeSecurity.as_view(),
name="knowledge_security",
),
path("consent/<int:pk>/", StudyConsent.as_view(), name="consent"),
path(
"translated/<int:pk>/", TranslatedConsentFormsView.as_view(), name="translated"
Expand Down
17 changes: 8 additions & 9 deletions proposals/utils/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,7 @@ def remaining_checkers(
self,
):
return [
KnowledgeSecurityChecker(
self.stepper,
parent=self.item
),
KnowledgeSecurityChecker(self.stepper, parent=self.item),
DocumentsChecker,
DataManagementChecker,
SubmitChecker,
Expand All @@ -352,7 +349,8 @@ def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
kwargs["proposal"] = self.proposal
return kwargs



class KnowledgeSecurityChecker(
ModelFormChecker,
):
Expand All @@ -364,10 +362,11 @@ def check(self):
self.title = _("Trajecten afronding")
self.stepper.items.append(self.make_stepper_item())
return []

def get_url(self,):
return reverse("proposals:knowledge_security",
args=[self.proposal.pk])

def get_url(
self,
):
return reverse("proposals:knowledge_security", args=[self.proposal.pk])


class StudyChecker(
Expand Down
8 changes: 6 additions & 2 deletions proposals/views/proposal_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,21 @@ def get_back_url(self):
"""Return to the Proposal Form page"""
return reverse("proposals:research_goal", args=(self.object.pk,))

class ProposalKnowledgeSecurity(ProposalContextMixin, AllowErrorsOnBackbuttonMixin, UpdateView):

class ProposalKnowledgeSecurity(
ProposalContextMixin, AllowErrorsOnBackbuttonMixin, UpdateView
):
model = Proposal
form_class = KnowledgeSecurityForm
template_name = "proposals/knowledge_security_form.html"

def get_next_url(self):
return reverse("proposals:consent", args=(self.object.pk,))

def get_back_url(self):
return reverse("studies:design_end", args=(self.object.last_study().pk,))


class TranslatedConsentFormsView(ProposalContextMixin, UpdateView):
model = Proposal
form_class = TranslatedConsentForm
Expand Down
2 changes: 1 addition & 1 deletion reviews/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_auto_review(self):

reasons = auto_review(self.proposal)
self.assertEqual(len(reasons), 8)

def test_auto_review_age_groups(self):
self.study.has_sessions = True
self.study.age_groups.set(AgeGroup.objects.filter(pk=2)) # toddlers
Expand Down
1 change: 0 additions & 1 deletion reviews/utils/review_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ def auto_review(proposal: Proposal):
)
)


return reasons


Expand Down
2 changes: 1 addition & 1 deletion studies/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def clean(self):
f"{field}_details",
f1_value_list=[YesNoDoubt.YES, YesNoDoubt.DOUBT],
)


class StudyUpdateAttachmentsForm(TemplatedModelForm):
class Meta:
Expand Down
18 changes: 9 additions & 9 deletions studies/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,16 @@ class Study(models.Model):
deception = models.CharField(
_(
"Is er binnen bovenstaand onderzoekstraject sprake van "
"misleiding van de deelnemer?"
"misleiding van de deelnemer?"
),
help_text=_(
'Misleiding is het doelbewust verschaffen van inaccurate '
'informatie over het doel en/of belangrijke aspecten van de gang van zaken '
'tijdens het onderzoek. Denk aan zaken als een bewust misleidende "cover story" '
'voor het experiment; het ten onrechte suggereren dat er door de deelnemer met andere '
'deelnemers wordt samengewerkt; het onaangekondigd aanbieden van een cruciale '
'geheugentaak of het geven van gefingeerde feedback. Wellicht ten overvloede: '
'het gaat hierbij niet om fillers in bijv. taalwetenschappelijk onderzoek.'
"Misleiding is het doelbewust verschaffen van inaccurate "
"informatie over het doel en/of belangrijke aspecten van de gang van zaken "
'tijdens het onderzoek. Denk aan zaken als een bewust misleidende "cover story" '
"voor het experiment; het ten onrechte suggereren dat er door de deelnemer met andere "
"deelnemers wordt samengewerkt; het onaangekondigd aanbieden van een cruciale "
"geheugentaak of het geven van gefingeerde feedback. Wellicht ten overvloede: "
"het gaat hierbij niet om fillers in bijv. taalwetenschappelijk onderzoek."
),
max_length=1,
choices=YesNoDoubt.choices,
Expand All @@ -293,7 +293,7 @@ class Study(models.Model):
deception_details = models.TextField(
_(
"Geef een toelichting en beschrijf hoe en wanneer de deelnemer "
"zal worden gedebrieft."
"zal worden gedebrieft."
),
blank=True,
)
Expand Down

0 comments on commit 712270f

Please sign in to comment.