Skip to content

Commit

Permalink
Update master from acceptation (#640)
Browse files Browse the repository at this point in the history
* Hotfix/to conclude review api view qs bug (#629)

* fix: add is_committee_review check to ToConcludeReviewApiView qs

* fix: add is_committee_review check to other API views

* formatting

---------

Co-authored-by: Ty Mees <[email protected]>

* fix: apply is_committee_review to filter in get_committee_decisions()

* formatting

* fix: Save reviews after closure in update_go

* fix: hacky changes to working of end_date in qs

* formatting

* 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

---------

Co-authored-by: Edo Storm <[email protected]>
Co-authored-by: Ty Mees <[email protected]>
Co-authored-by: Edo Storm <[email protected]>
  • Loading branch information
4 people authored Mar 27, 2024
1 parent 2989b7a commit 00602f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fetc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion proposals/utils/pdf_diff_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def create_unordered_html_list(self, lst):
def handle_field_file(self, field_file):
if field_file:
output = format_html(
"<a href=https://{}>{}</a>",
'<a href="{}">{}</a>',
f"{settings.BASE_URL}{field_file.url}",
_("Download"),
)
Expand Down
1 change: 1 addition & 0 deletions reviews/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions reviews/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -159,11 +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__stage__gt=Review.Stages.SUPERVISOR,
decision__review__date_start__lte=end_date,
)
return reviewers.annotate(
total=Count("decision", filter=base_filter),
Expand Down

0 comments on commit 00602f5

Please sign in to comment.