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
333dcf2b
Commit
333dcf2b
authored
5 months ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
DSN: Výklad běžných status kódů
parent
a0f76898
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/util_dsn.py
+28
-0
28 additions, 0 deletions
mo/util_dsn.py
mo/web/jinja.py
+2
-0
2 additions, 0 deletions
mo/web/jinja.py
mo/web/templates/parts/dsn.html
+1
-1
1 addition, 1 deletion
mo/web/templates/parts/dsn.html
with
31 additions
and
1 deletion
mo/util_dsn.py
0 → 100644
+
28
−
0
View file @
333dcf2b
# Utility na práci s mailovými nedoručenkami
from
typing
import
Optional
dsn_explanation
=
{
'
4.2.2
'
:
'
schránka je plná
'
,
'
4.4.1
'
:
'
server nepřijímá spojení
'
,
'
5.1.1
'
:
'
adresa neexistuje
'
,
'
5.1.10
'
:
'
doména nepřijímá poštu
'
,
# Null MX
'
5.2.1
'
:
'
schránka je zablokována
'
,
'
5.2.2
'
:
'
schránka je plná
'
,
'
5.4.1
'
:
'
server nepřijímá spojení
'
,
'
5.4.6
'
:
'
cyklické přeposílání pošty
'
,
'
5.4.14
'
:
'
cyklické přeposílání pošty
'
,
# nestandardní status od MS Exchange
'
5.7.1
'
:
'
příjem pošty zakázán pravidly cílové sítě
'
,
}
def
format_dsn_status
(
status
:
Optional
[
str
])
->
str
:
if
not
status
:
return
'
–
'
else
:
explain
=
dsn_explanation
.
get
(
status
)
if
explain
:
return
f
'
{
status
}
–
{
explain
}
'
else
:
return
status
This diff is collapsed.
Click to expand it.
mo/web/jinja.py
+
2
−
0
View file @
333dcf2b
...
@@ -14,6 +14,7 @@ import mo.place_level
...
@@ -14,6 +14,7 @@ import mo.place_level
import
mo.points
import
mo.points
from
mo.rights
import
Right
from
mo.rights
import
Right
from
mo.util
import
assert_not_none
from
mo.util
import
assert_not_none
from
mo.util_dsn
import
format_dsn_status
import
mo.util_format
as
util_format
import
mo.util_format
as
util_format
from
mo.web
import
app
from
mo.web
import
app
from
mo.web.org_place
import
place_breadcrumbs
from
mo.web.org_place
import
place_breadcrumbs
...
@@ -69,6 +70,7 @@ jg.update(Right=Right)
...
@@ -69,6 +70,7 @@ jg.update(Right=Right)
jg
.
update
(
place_breadcrumbs
=
place_breadcrumbs
)
jg
.
update
(
place_breadcrumbs
=
place_breadcrumbs
)
# Funkce asset_url se přidává v mo.ext.assets
# Funkce asset_url se přidává v mo.ext.assets
jf
.
update
(
dsn_status
=
format_dsn_status
)
jf
.
update
(
user_url
=
user_url
)
jf
.
update
(
user_url
=
user_url
)
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/parts/dsn.html
+
1
−
1
View file @
333dcf2b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<td>
{{ dsn.arrived_at|time_and_timedelta }}
<td>
{{ dsn.arrived_at|time_and_timedelta }}
<tr>
<tr>
<th>
Kód chyby
<th>
Kód chyby
<td>
{{ dsn.status }}
<td>
{{ dsn.status
|dsn_status
}}
<tr>
<tr>
<th>
Chybová zpráva
<th>
Chybová zpráva
<td>
{{ dsn.diag_code|or_dash }}
<td>
{{ dsn.diag_code|or_dash }}
...
...
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