Skip to content
Snippets Groups Projects

Sazba diplomů

2 files
+ 14
1
Compare changes
  • Side-by-side
  • Inline

Files

+ 8
0
@@ -135,6 +135,12 @@ class CertMaker:
if row is not None and row.get('honorary_mention', False):
add_cert(db.CertType.honorary_mention, 'za úplné vyřešení úlohy', user.sort_key())
def prepare_files(self) -> None:
if self.cset.background_file:
background = os.path.join(self.job_dir, 'background.pdf')
mo.util.unlink_if_exists(background)
os.link(os.path.join(self.certs_dir, self.cset.background_file), background)
def make_certs(self, cert_type: db.CertType) -> None:
certs = [cert for cert in self.certs if cert.type == cert_type]
if not certs:
@@ -165,6 +171,7 @@ class CertMaker:
'signerBtitle': self.cset.signer2_title,
'issueplace': self.cset.issue_place,
'issuedate': self.cset.issue_date,
'background': "background.pdf" if self.cset.background_file else "",
}
if self.round.round_type in (db.RoundType.okresni, db.RoundType.krajske):
ga['oblast'] = self.place.name
@@ -261,6 +268,7 @@ class CertMaker:
def handle_create_protocols(the_job: TheJob):
cm = CertMaker(the_job)
cm.plan()
cm.prepare_files()
for ctype in db.CertType:
cm.make_certs(ctype)
cm.store_results()
Loading