Skip to content

Commit 296b126

Browse files
author
Sasha Romijn
committed
Ref ietf-tools#2231 - Fix send-review-reminders and add it to daily cron
This fixes a syntax error and a Python 3 incompatibility, and adds send-review-reminders to the daily cron script. Important notes: - I have not tested to what degree the existing reminders work as they should, as that's out of scope. It does have tests. - I can't assess whether the virtualenv activation works in the production setup, and it may be obsolete as bin/daily also activates the virtualenv. - The same Python 3 incompatibility (execfile() no longer exists) seems to exist in various other scripts. Commit ready for merge. - Legacy-Id: 16703
1 parent 68ea11a commit 296b126

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

bin/daily

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ $DTDIR/ietf/bin/rfc-editor-index-updates -d 1969-01-01
5050
# Fetch meeting attendance data from ietf.org/registration/attendees
5151
$DTDIR/ietf/manage.py fetch_meeting_attendance --latest 2
5252

53+
# Send reminders originating from the review app
54+
$DTDIR/ietf/bin/send-review-reminders

ietf/bin/send-review-reminders

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22

3-
import os, sys
3+
import os
4+
import sys
45
import syslog
56

67
# boilerplate
@@ -10,7 +11,9 @@ os.environ["DJANGO_SETTINGS_MODULE"] = "ietf.settings"
1011

1112
virtualenv_activation = os.path.join(basedir, "env", "bin", "activate_this.py")
1213
if os.path.exists(virtualenv_activation):
13-
execfile(virtualenv_activation, dict(__file__=virtualenv_activation))
14+
with open(virtualenv_activation, 'rb') as f:
15+
code = compile(f.read(), virtualenv_activation, 'exec')
16+
exec(code, globals=dict(__name__="__main__", __file__=virtualenv_activation))
1417

1518
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_USER)
1619

@@ -27,11 +30,10 @@ today = datetime.date.today()
2730

2831
for assignment in review_assignments_needing_reviewer_reminder(today):
2932
email_reviewer_reminder(assignment.review_request)
30-
for review_assignment in assignments.review_req.reviewassignment_set.all():
33+
for review_assignment in assignment.review_req.reviewassignment_set.all():
3134
print("Emailed reminder to {} for review of {} in {} (req. id {})".format(review_assignment.reviewer.address, assignment.review_req.doc_id, assignment.review_req.team.acronym, assignment.review_req.pk))
3235

3336
for assignment, secretary_role in review_assignments_needing_secretary_reminder(today):
3437
email_secretary_reminder(assignment.review_request, secretary_role)
3538
review_req = assignment.review_request
3639
print("Emailed reminder to {} for review of {} in {} (req. id {})".format(secretary_role.email.address, review_req.doc_id, review_req.team.acronym, review_req.pk))
37-

0 commit comments

Comments
 (0)