From d3c8684f4615b17c6bd324f0d9714b7a5619ac36 Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Fri, 17 Jan 2020 15:19:12 +0600 Subject: [PATCH] Add comments to weekly RA logic. --- backend/backend/settings/base.py | 2 +- backend/profile_page/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/backend/settings/base.py b/backend/backend/settings/base.py index f9714101b..939263f53 100644 --- a/backend/backend/settings/base.py +++ b/backend/backend/settings/base.py @@ -288,4 +288,4 @@ def check_ip_range(ipr): GITHUB_APP_CLIENT_SECRET = os.getenv('GITHUB_APP_CLIENT_SECRET') # Github App Client Secret GITHUB_APP_REDIRECT_URL = os.getenv('GITHUB_APP_REDIRECT_URL') # Github App Redirect URL -MAX_WEEKLY_RA = 5 +MAX_WEEKLY_RA = 5 # The number of RAs for the user to resolve in a week (starting this Monday) diff --git a/backend/profile_page/models.py b/backend/profile_page/models.py index 6083194cb..46c2ae8e9 100644 --- a/backend/profile_page/models.py +++ b/backend/profile_page/models.py @@ -56,7 +56,7 @@ def actions_count(self): @property def actions_resolved_since_monday(self): - monday = (timezone.now() - relativedelta(weekday=MO(-1))).date() + monday = (timezone.now() - relativedelta(weekday=MO(-1))).date() # Find this week's monday return min(RecommendedAction.objects.filter(device__owner=self.user, resolved_at__gte=monday)\ .values('action_id').distinct().count(), settings.MAX_WEEKLY_RA)