Skip to content
Snippets Groups Projects
Commit 3854ffcc authored by Martin Mareš's avatar Martin Mareš
Browse files

Merge branch 'honza/mr2' into 'devel'

Import: Upozornit na chybějící # v kódu školy/místa

See merge request mj/mo-submit!60
parents 43b34bf8 4f7cf53e
No related branches found
No related tags found
1 merge request!60Import: Upozornit na chybějící # v kódu školy/místa
...@@ -133,7 +133,8 @@ class Import: ...@@ -133,7 +133,8 @@ class Import:
place = db.get_place_by_code(kod) place = db.get_place_by_code(kod)
if not place: if not place:
return self.error(f'Místo "{kod}" nenalezeno') return self.error(f'Místo s kódem "{kod}" nenalezeno'+
('. Nechybí vám # na začátku?' if re.fullmatch(r'\d+', kod) else ''))
if not self.check_rights(place): if not self.check_rights(place):
return self.error(f'K místu "{kod}" nemáte práva na správu soutěže') return self.error(f'K místu "{kod}" nemáte práva na správu soutěže')
...@@ -150,7 +151,8 @@ class Import: ...@@ -150,7 +151,8 @@ class Import:
place = db.get_place_by_code(kod, fetch_school=True) place = db.get_place_by_code(kod, fetch_school=True)
if not place: if not place:
return self.error(f'Škola "{kod}" nenalezena') return self.error(f'Škola s kódem "{kod}" nenalezena'+
('. Nechybí vám # na začátku?' if re.fullmatch(r'\d+', kod) else ''))
if place.type != db.PlaceType.school: if place.type != db.PlaceType.school:
return self.error(f'Kód školy "{kod}" neodpovídá škole') return self.error(f'Kód školy "{kod}" neodpovídá škole')
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment