Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
d5c26c39
Commit
d5c26c39
authored
3 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
V e-mailových notifikacích uvádíme i URL seznamu účastníků
parent
231a962a
Branches
Branches containing commit
No related tags found
1 merge request
!86
Registrace
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/email.py
+11
-0
11 additions, 0 deletions
mo/email.py
mo/web/org_contest.py
+1
-0
1 addition, 0 deletions
mo/web/org_contest.py
with
12 additions
and
0 deletions
mo/email.py
+
11
−
0
View file @
d5c26c39
...
...
@@ -73,6 +73,13 @@ def confirm_url(type: str, token: str) -> str:
return
config
.
WEB_ROOT
+
f
'
auth/confirm/
{
type
}
?
'
+
urllib
.
parse
.
urlencode
({
'
token
'
:
token
},
safe
=
'
:
'
)
def
contestant_list_url
(
contest
:
db
.
Contest
,
registered_only
:
bool
)
->
str
:
url
=
config
.
WEB_ROOT
+
f
'
org/contest/c/
{
contest
.
contest_id
}
/ucastnici
'
if
registered_only
:
url
+=
'
?participation_state=registered
'
return
url
def
send_new_account_email
(
user
:
db
.
User
,
token
:
str
)
->
bool
:
return
send_user_email
(
user
,
'
Založen nový účet
'
,
textwrap
.
dedent
(
'''
\
Vítejte!
...
...
@@ -127,8 +134,10 @@ def send_join_notify_email(dest: db.User, who: db.User, contest: db.Contest) ->
place
=
contest
.
place
if
contest
.
round
.
enroll_mode
==
db
.
RoundEnrollMode
.
confirm
:
confirm
=
'
Přihlášku je potřeba potvrdit v seznamu účastníků soutěže.
'
url
=
'
Přihlášky k potvrzení:
'
+
contestant_list_url
(
contest
,
True
)
else
:
confirm
=
'
Přihláška byla schválena automaticky.
'
url
=
'
Seznam účastníků:
'
+
contestant_list_url
(
contest
,
False
)
return
send_user_email
(
dest
,
f
'
Nový účastník kategorie
{
round
.
category
}
'
,
textwrap
.
dedent
(
f
'''
\
Nový účastník se přihlásil do MO v oblasti, kterou garantujete.
...
...
@@ -141,5 +150,7 @@ def send_join_notify_email(dest: db.User, who: db.User, contest: db.Contest) ->
{
confirm
}
{
url
}
Váš OSMO
'''
))
This diff is collapsed.
Click to expand it.
mo/web/org_contest.py
+
1
−
0
View file @
d5c26c39
...
...
@@ -442,6 +442,7 @@ def org_contest_import(id: int):
)
# URL je explicitně uvedeno v mo.email.contestant_list_url
@app.route
(
'
/org/contest/c/<int:id>/ucastnici
'
,
methods
=
(
'
GET
'
,
'
POST
'
))
@app.route
(
'
/org/contest/c/<int:id>/site/<int:site_id>/ucastnici
'
,
methods
=
(
'
GET
'
,
'
POST
'
))
@app.route
(
'
/org/contest/c/<int:id>/ucastnici/emails
'
,
endpoint
=
"
org_contest_list_emails
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment