Skip to content

Commit

Permalink
Merge pull request #639 from DH-IT-Portal-Development/develop
Browse files Browse the repository at this point in the history
Update acceptation from develop
  • Loading branch information
EdoStorm96 authored Mar 27, 2024
2 parents b2d6ecf + 6b2e098 commit 96276d3
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 96276d3

Please sign in to comment.