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
7cfa1b87
Commit
7cfa1b87
authored
5 months ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
DSN: Na účty s nedosažitelnou adresou neposíláme notifikace
parent
636af5ef
No related branches found
No related tags found
1 merge request
!138
Zpracování nedoručenek
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mo/db.py
+4
-0
4 additions, 0 deletions
mo/db.py
mo/jobs/notify.py
+1
-1
1 addition, 1 deletion
mo/jobs/notify.py
mo/web/user.py
+2
-2
2 additions, 2 deletions
mo/web/user.py
with
7 additions
and
3 deletions
mo/db.py
+
4
−
0
View file @
7cfa1b87
...
@@ -467,6 +467,10 @@ class User(Base):
...
@@ -467,6 +467,10 @@ class User(Base):
def
is_system
(
self
)
->
bool
:
def
is_system
(
self
)
->
bool
:
return
self
.
user_id
==
0
return
self
.
user_id
==
0
@property
def
wants_notify
(
self
)
->
bool
:
return
self
.
email_notify
and
self
.
dsn_id
is
None
def
get_system_user
()
->
User
:
def
get_system_user
()
->
User
:
"""
Uživatel s user_id=0 je systémový (viz db.ddl)
"""
"""
Uživatel s user_id=0 je systémový (viz db.ddl)
"""
...
...
This diff is collapsed.
Click to expand it.
mo/jobs/notify.py
+
1
−
1
View file @
7cfa1b87
...
@@ -70,7 +70,7 @@ def handle_send_grading_info(the_job: TheJob):
...
@@ -70,7 +70,7 @@ def handle_send_grading_info(the_job: TheJob):
for
user
,
sent
in
todo
:
for
user
,
sent
in
todo
:
num_total
+=
1
num_total
+=
1
if
not
user
.
email
_notify
:
if
not
user
.
wants
_notify
:
num_dont_want
+=
1
num_dont_want
+=
1
elif
sent
:
elif
sent
:
num_before
+=
1
num_before
+=
1
...
...
This diff is collapsed.
Click to expand it.
mo/web/user.py
+
2
−
2
View file @
7cfa1b87
...
@@ -266,8 +266,8 @@ def join_notify(c: db.Contest) -> None:
...
@@ -266,8 +266,8 @@ def join_notify(c: db.Contest) -> None:
notify
=
{
ur
.
user
for
ur
in
uroles
if
ur
.
applies_to
(
at
=
place
,
year
=
r
.
year
,
cat
=
r
.
category
,
seq
=
r
.
seq
)}
notify
=
{
ur
.
user
for
ur
in
uroles
if
ur
.
applies_to
(
at
=
place
,
year
=
r
.
year
,
cat
=
r
.
category
,
seq
=
r
.
seq
)}
if
notify
:
if
notify
:
for
org
in
notify
:
for
org
in
notify
:
logger
.
info
(
f
'
Join:
{
"
Notifikuji
"
if
org
.
email
_notify
else
"
Nenotifikuji
"
}
orga <
{
org
.
email
}
> pro místo
{
place
.
get_code
()
}
'
)
logger
.
info
(
f
'
Join:
{
"
Notifikuji
"
if
org
.
wants
_notify
else
"
Nenotifikuji
"
}
orga <
{
org
.
email
}
> pro místo
{
place
.
get_code
()
}
'
)
if
org
.
email
_notify
:
if
org
.
wants
_notify
:
mo
.
email
.
send_join_notify_email
(
org
,
g
.
user
,
c
)
mo
.
email
.
send_join_notify_email
(
org
,
g
.
user
,
c
)
return
return
place
=
place
.
parent_place
place
=
place
.
parent_place
...
...
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