Skip to content

Commit

Permalink
changed is_commission_review to is_committee_review + minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
EdoStorm96 committed Nov 16, 2023
1 parent 7ef30ec commit 75ab28a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Generated by Django 3.2.20 on 2023-11-16 09:41
# Generated by Django 3.2.20 on 2023-11-16 13:13

from django.db import migrations, models


class Migration(migrations.Migration):

replaces = [('proposals', '0050_alter_proposal_avg_understood'), ('proposals', '0051_auto_20231116_1030')]

dependencies = [
('proposals', '0049_alter_proposal_supervisor'),
]
Expand Down
2 changes: 1 addition & 1 deletion proposals/templates/proposals/proposal_pdf.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
{% block page_header %}
<div id="page-header">
{% 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 }})
FETC-GW - <em>{{ title }}</em> (referentienummer {{reviewing_committee}}-{{ reference_number }}, ingediend door {{ submitter }})
{% endblocktrans %}
{% if proposal.is_revision %}
<br>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Generated by Django 3.2.20 on 2023-11-14 09:46
# Generated by Django 3.2.20 on 2023-11-16 13:01

from django.db import migrations, models

def update_is_commssion_review(apps, schema_editor):
def update_is_committee_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
#Hardcoded these to account for possible future changes to stages
SUPERVISOR_STAGE = 0
CLOSED_STAGE = 4
if review.stage == SUPERVISOR_STAGE:
review.is_commission_review = False
review.update_go()
review.is_committee_review = False
if review.go:
review.stage = CLOSED_STAGE
review.save()

class Migration(migrations.Migration):
Expand All @@ -23,8 +25,8 @@ class Migration(migrations.Migration):
operations = [
migrations.AddField(
model_name='review',
name='is_commission_review',
name='is_committee_review',
field=models.BooleanField(default=True),
),
migrations.RunPython(update_is_commssion_review),
migrations.RunPython(update_is_committee_review),
]
4 changes: 2 additions & 2 deletions reviews/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Review(models.Model):
date_end = models.DateTimeField(blank=True, null=True)
date_should_end = models.DateField(blank=True, null=True)

is_commission_review = models.BooleanField(
is_committee_review = models.BooleanField(
default=True
)

Expand Down Expand Up @@ -93,7 +93,7 @@ def update_go(self, last_decision=None):
self.save()

# For a supervisor review:
if self.is_commission_review == False:
if self.is_committee_review == False:
# Update the status of the Proposal with the end date
self.proposal.date_reviewed_supervisor = self.date_end
self.proposal.save()
Expand Down
2 changes: 1 addition & 1 deletion reviews/templates/reviews/review_detail_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h3>
</em>
</li>
{% endif %}
{% if review.is_commission_review == False %}
{% if not review.is_committee_review %}
<li>
<strong>
{% blocktrans trimmed %}
Expand Down
6 changes: 3 additions & 3 deletions reviews/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_start_supervisor_review(self):
# If the Relation on a Proposal requires a supervisor, a Review for the supervisor should be started.
review = start_review(self.proposal)
self.assertEqual(review.stage, Review.SUPERVISOR)
self.assertEqual(review.is_commission_review, False)
self.assertEqual(review.is_committee_review, False)
self.assertEqual(Decision.objects.filter(reviewer=self.supervisor).count(), 1)
self.assertEqual(Decision.objects.filter(review=review).count(), 1)
self.assertEqual(review.decision_set.count(), 1)
Expand All @@ -171,7 +171,7 @@ def test_start_review(self):

review = start_review(self.proposal)
self.assertEqual(review.stage, Review.ASSIGNMENT)
self.assertEqual(review.is_commission_review, True)
self.assertEqual(review.is_committee_review, True)
self.assertEqual(Decision.objects.filter(reviewer=self.secretary).count(), 1)
self.assertEqual(Decision.objects.filter(review=review).count(), 1)
self.assertEqual(review.decision_set.count(), 1)
Expand All @@ -198,7 +198,7 @@ def test_decision_supervisor(self):
decision.save()
review.refresh_from_db()
self.assertEqual(review.go, True)
self.assertEqual(review.is_commission_review, False)
self.assertEqual(review.is_committee_review, False)

self.assertEqual(len(mail.outbox), 2)
self.check_subject_lines(mail.outbox)
Expand Down
2 changes: 1 addition & 1 deletion reviews/utils/review_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def start_supervisor_phase(proposal):
"""
review = Review.objects.create(proposal=proposal, date_start=timezone.now())
review.stage = Review.SUPERVISOR
review.is_commission_review = False
review.is_committee_review = False
review.save()

proposal.date_submitted_supervisor = timezone.now()
Expand Down
2 changes: 1 addition & 1 deletion reviews/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 review.is_commission_review == True:
if review.is_committee_review:
notify_secretary(form.instance)

return super(DecisionUpdateView, self).form_valid(form)

0 comments on commit 75ab28a

Please sign in to comment.