From 35d9f0ccd17f860a02b53b2f5edcc08d5bc9bf00 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Thu, 23 Jul 2015 22:50:36 +0200 Subject: [PATCH] Oprava nastaveni posilani chybovych mailu --- mamweb/settings_prod.py | 7 +++++-- seminar/models.py | 7 +++++-- seminar/templates/seminar/archiv/cislo_vysledkovka.tex | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mamweb/settings_prod.py b/mamweb/settings_prod.py index fd7a5206..74897882 100644 --- a/mamweb/settings_prod.py +++ b/mamweb/settings_prod.py @@ -33,8 +33,11 @@ DATABASES = { import os -SERVER_EMAIL = 'prod-errors@mam.mff.cuni.cz' -ADMINS = ['gavento@ucw.cz', ] +SERVER_EMAIL = 'mamweb-prod-errors@mam.mff.cuni.cz' +ADMINS = [ + ('Tomas Gavenciak', 'gavento@ucw.cz'), + ] + # LOGGING = { # 'version': 1, diff --git a/seminar/models.py b/seminar/models.py index a11c9393..cdbd7f89 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -211,7 +211,10 @@ class Resitel(SeminarModelBase): } def rocnik(self, datum): - "Vypise skolni rocnik resitele pro zadane datum typu datetime." + """Vypise skolni rocnik resitele pro zadane datum typu datetime. + Vraci None pro neznamy rocnik.""" + if self.rok_maturity is None: + return None rozdil = self.rok_maturity - datum.year if datum.month < 9: return 4 - rozdil @@ -221,7 +224,7 @@ class Resitel(SeminarModelBase): def titul(self, celkove_body): "Vrati titul podle zadaneho poctu bodu." if celkove_body < 10: - return None + return '' elif celkove_body < 20: return 'Bc.' elif celkove_body < 50: diff --git a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex index 6da4e44f..e39e0c2c 100644 --- a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex +++ b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex @@ -24,7 +24,7 @@ {% if rv.resitel.titul %} \titul{ {{ rv.resitel.titul }} } {% endif %} - {{ rv.resitel.plne_jmeno }} & {{ rv.resitel.rocnik}} & {{ rv.body_minule }} + {{ rv.resitel.plne_jmeno }} & {{ rv.resitel.rocnik |default:"" }} & {{ rv.body_minule }} {% for b in rv.body %} {{ b }} & {% endfor %}