Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
Add comments to weekly RA logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-martynovich committed Jan 17, 2020
1 parent ad74b30 commit d3c8684
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/backend/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion backend/profile_page/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit d3c8684

Please sign in to comment.