Skip to content

Commit fc3e445

Browse files
authored
Add user login to confirmation email template (#141)
1 parent 864e0e2 commit fc3e445

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

oioioi/confirmations/templates/confirmations/email_body.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This is a confirmation that we have received your submission
44
to the {{ contest }} contest:
55

6+
OIOIOI login: {{ user_login }}
67
Contest id: {{ contest_id }}
78
Problem: {{ problem_shortname }}
89
Submission id: {{ submission_id }}

oioioi/confirmations/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def test_sending_receipt(self):
7979

8080
email = mail.outbox[0].message().as_string()
8181
del mail.outbox[0]
82+
self.assertIn("OIOIOI login: test_user", email)
83+
self.assertIn(f"Contest id: {contest.id}", email)
84+
self.assertIn(f"Problem: {problem_instance.short_name}", email)
8285
self.assertIn("Submissions to this task: 2", email)
8386
self.assertIn("1337 bytes", email)
8487
proof = re.search(

oioioi/confirmations/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def send_submission_receipt_confirmation(request, submission):
110110
'problem_shortname': proof_data['problem_name'],
111111
'size': proof_data['size'],
112112
'full_name': submission.user.get_full_name(),
113+
'user_login': submission.user.username
113114
}
114115

115116
subject = render_to_string('confirmations/email_subject.txt', context)

0 commit comments

Comments
 (0)