Skip to content
Snippets Groups Projects
Commit 8bd91843 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Import: Výchozí oblast

parent 774103f3
No related branches found
No related tags found
1 merge request!97Import orgů
......@@ -528,6 +528,9 @@ class OrgsImport(Import):
oblast = self.parse_opt_place(r.kod_oblasti, 'oblast')
role = self.parse_role(r.role)
if oblast is None:
oblast = self.default_place
if role != db.RoleType.opravovatel:
contest = self.obtain_contest(oblast, allow_none=True)
place = contest.place if contest else self.root_place
......@@ -705,7 +708,8 @@ def create_import(user: db.User,
only_region: Optional[db.Place] = None,
task: Optional[db.Task] = None,
allow_add_del: bool = False,
allow_change_user_to_org: bool = False):
allow_change_user_to_org: bool = False,
default_place: Optional[db.Place] = None):
imp: Import
if type == ImportType.participants:
imp = ContestImport()
......@@ -725,6 +729,7 @@ def create_import(user: db.User,
imp.allow_add_del = allow_add_del
imp.fmt = fmt
imp.gatekeeper = mo.rights.Gatekeeper(user)
imp.default_place = default_place
imp.setup()
return imp
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment