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
MO-P
Odevzdávací Systém MO
Commits
8c850e50
Commit
8c850e50
authored
Sep 29, 2023
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Import: Nerozlišitelní účastníci jsou chyba
parent
8053f7c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/imports.py
+7
-0
7 additions, 0 deletions
mo/imports.py
with
7 additions
and
0 deletions
mo/imports.py
+
7
−
0
View file @
8c850e50
...
@@ -491,6 +491,7 @@ class ContestImport(Import):
...
@@ -491,6 +491,7 @@ class ContestImport(Import):
log_msg_prefix
=
'
Účastníci
'
log_msg_prefix
=
'
Účastníci
'
log_details
=
{
'
action
'
:
'
import
'
}
log_details
=
{
'
action
'
:
'
import
'
}
template_basename
=
'
sablona-ucast
'
template_basename
=
'
sablona-ucast
'
email_last_seen
:
Dict
[
str
,
int
]
def
__init__
(
def
__init__
(
self
,
self
,
...
@@ -512,6 +513,7 @@ class ContestImport(Import):
...
@@ -512,6 +513,7 @@ class ContestImport(Import):
self
.
row_example
.
kod_skoly
=
default_place
.
get_code
()
self
.
row_example
.
kod_skoly
=
default_place
.
get_code
()
else
:
else
:
self
.
row_example
.
kod_skoly
=
'
#3333
'
self
.
row_example
.
kod_skoly
=
'
#3333
'
self
.
email_last_seen
=
{}
assert
not
self
.
round
.
is_subround
()
assert
not
self
.
round
.
is_subround
()
def
import_row
(
self
,
r
:
mo
.
csv
.
Row
)
->
None
:
def
import_row
(
self
,
r
:
mo
.
csv
.
Row
)
->
None
:
...
@@ -542,6 +544,11 @@ class ContestImport(Import):
...
@@ -542,6 +544,11 @@ class ContestImport(Import):
email
=
mo
.
users
.
email_or_synthesize
(
email
,
krestni
,
prijmeni
,
rocnik
,
school_place
)
email
=
mo
.
users
.
email_or_synthesize
(
email
,
krestni
,
prijmeni
,
rocnik
,
school_place
)
except
mo
.
CheckError
as
e
:
except
mo
.
CheckError
as
e
:
return
self
.
error
(
str
(
e
))
return
self
.
error
(
str
(
e
))
if
email
in
self
.
email_last_seen
:
return
self
.
error
(
f
'
Účastník není rozlišitelný od toho z řádku
{
self
.
email_last_seen
[
email
]
}
. Případné jmenovce vyřešte ručním přidáním účastníka.
'
)
self
.
email_last_seen
[
email
]
=
self
.
line_number
user
=
self
.
find_or_create_user
(
email
,
krestni
,
prijmeni
,
is_org
=
False
)
user
=
self
.
find_or_create_user
(
email
,
krestni
,
prijmeni
,
is_org
=
False
)
if
user
is
None
:
if
user
is
None
:
return
return
...
...
...
...
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
sign in
to comment