From 9d0e951ffd0c5af813531cea8f5933a2bc2ca7f0 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 26 Mar 2024 11:48:30 +0100 Subject: [PATCH 1/6] fix: apply is_committee_review to filter in get_committee_decisions() --- reviews/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reviews/views.py b/reviews/views.py index bbe716f2e..8d82287cc 100644 --- a/reviews/views.py +++ b/reviews/views.py @@ -132,7 +132,8 @@ def get_context_data(self, **kwargs): def get_committee_decisions(self): decisions = Decision.objects.filter( - review__proposal__reviewing_committee=self.committee + review__proposal__reviewing_committee=self.committee, + review__is_committee_review = True, ).select_related( "reviewer", "review", @@ -163,7 +164,6 @@ def get_review_counts_last_year(self): base_filter = Q( decision__review__date_start__gt=self.start_date, decision__review__date_start__lt=self.end_date, - decision__review__stage__gt=Review.Stages.SUPERVISOR, ) return reviewers.annotate( total=Count("decision", filter=base_filter), From f74b6b8ee913ed196e854447f9344e96fd4954ab Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 26 Mar 2024 11:56:44 +0100 Subject: [PATCH 2/6] formatting --- reviews/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reviews/views.py b/reviews/views.py index 8d82287cc..cedd93c76 100644 --- a/reviews/views.py +++ b/reviews/views.py @@ -133,7 +133,7 @@ def get_context_data(self, **kwargs): def get_committee_decisions(self): decisions = Decision.objects.filter( review__proposal__reviewing_committee=self.committee, - review__is_committee_review = True, + review__is_committee_review=True, ).select_related( "reviewer", "review", From deb648ce60bd79a7596b44acd235c89f819055ea Mon Sep 17 00:00:00 2001 From: Michael Villeneuve Date: Tue, 26 Mar 2024 15:09:07 +0100 Subject: [PATCH 3/6] fix: Save reviews after closure in update_go --- reviews/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/reviews/models.py b/reviews/models.py index 24f5d8334..78ede667e 100644 --- a/reviews/models.py +++ b/reviews/models.py @@ -80,6 +80,7 @@ def update_go(self, last_decision=None): start_assignment_phase(self.proposal) self.stage = self.Stages.CLOSED + self.save() # On NO-GO, reset the Proposal status else: # See comment above From 5fd17fb429d0acde3a3b3c54b2f20a7262f1582d Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 26 Mar 2024 15:49:39 +0100 Subject: [PATCH 4/6] fix: hacky changes to working of end_date in qs --- reviews/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reviews/views.py b/reviews/views.py index cedd93c76..ac89022c0 100644 --- a/reviews/views.py +++ b/reviews/views.py @@ -160,10 +160,15 @@ def get_review_counts_last_year(self): decisions = self.get_committee_decisions() + # This is done to include in the base_filter, decisions which are taken + # today. The comparison was having some troubles due to different + #time formats. + end_date = self.end_date + timedelta(days=1) + reviewers = get_user_model().objects.filter(decision__in=decisions) base_filter = Q( decision__review__date_start__gt=self.start_date, - decision__review__date_start__lt=self.end_date, + decision__review__date_start__lte=end_date, ) return reviewers.annotate( total=Count("decision", filter=base_filter), From 5fb7a4750da51fff02601142fea8a4710034782d Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 26 Mar 2024 15:51:09 +0100 Subject: [PATCH 5/6] formatting --- reviews/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reviews/views.py b/reviews/views.py index ac89022c0..3b9c4e9a8 100644 --- a/reviews/views.py +++ b/reviews/views.py @@ -162,7 +162,7 @@ def get_review_counts_last_year(self): # This is done to include in the base_filter, decisions which are taken # today. The comparison was having some troubles due to different - #time formats. + # time formats. end_date = self.end_date + timedelta(days=1) reviewers = get_user_model().objects.filter(decision__in=decisions) From 72c2181568f2d9ad4ca3523c80e19d4bb19810e9 Mon Sep 17 00:00:00 2001 From: Michael Villeneuve Date: Wed, 27 Mar 2024 12:33:37 +0100 Subject: [PATCH 6/6] fix: remove explicit protocol prefix from file links (#637) * fix: remove explicit protocol prefix from file links Also adding quotations around the URL * feat: Add protocol prefix to BASE_URL for consistency --- fetc/settings.py | 2 +- proposals/utils/pdf_diff_logic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fetc/settings.py b/fetc/settings.py index 6b753f47e..b76c91907 100644 --- a/fetc/settings.py +++ b/fetc/settings.py @@ -158,7 +158,7 @@ MENU_HIDE_EMPTY = False # Base URL -BASE_URL = "127.0.0.1:8000" +BASE_URL = "https://127.0.0.1:8000" # CSRF Setting CSRF_FAILURE_VIEW = "main.error_views.csrf_failure" diff --git a/proposals/utils/pdf_diff_logic.py b/proposals/utils/pdf_diff_logic.py index ff2489d23..e19a2f88f 100644 --- a/proposals/utils/pdf_diff_logic.py +++ b/proposals/utils/pdf_diff_logic.py @@ -286,7 +286,7 @@ def create_unordered_html_list(self, lst): def handle_field_file(self, field_file): if field_file: output = format_html( - "{}", + '{}', f"{settings.BASE_URL}{field_file.url}", _("Download"), )