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

Diplomy: Opraven pád při uploadu obrázku během založení sady diplomů

parent b57fd9a8
No related branches found
No related tags found
No related merge requests found
...@@ -176,6 +176,10 @@ def org_certificates(ct_id: int): ...@@ -176,6 +176,10 @@ def org_certificates(ct_id: int):
form.populate_obj(cset) form.populate_obj(cset)
form.populate_obj(dparams) form.populate_obj(dparams)
cset.design_params = dparams.to_json() cset.design_params = dparams.to_json()
if new_cset:
# To je potřeba udělat už teď, protože cset.dir_path() níže potřebuje funkční relationships
sess.add(cset)
sess.flush()
if dparams.background_type == BackgroundType.custom: if dparams.background_type == BackgroundType.custom:
if form.upload_background.data: if form.upload_background.data:
old_background = cset.background_file old_background = cset.background_file
...@@ -194,7 +198,6 @@ def org_certificates(ct_id: int): ...@@ -194,7 +198,6 @@ def org_certificates(ct_id: int):
cset.background_file = None cset.background_file = None
changes = None changes = None
if new_cset: if new_cset:
sess.add(cset)
mo.util.log( mo.util.log(
type=db.LogType.cert_set, type=db.LogType.cert_set,
what=contest.contest_id, what=contest.contest_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment