Browse Source

Opraveny vadné odkazy v adminu?

middleware_test
Jonas Havelka 3 years ago
parent
commit
0042ed862c
  1. 10
      seminar/models.py

10
seminar/models.py

@ -44,15 +44,15 @@ class SeminarModelBase(models.Model):
def verejne(self):
return False
def get_absolute_url(self):
return self.verejne_url() # TODO "absolute"
# def get_absolute_url(self):
# return self.verejne_url() # TODO "absolute"
def admin_url(self):
model_name = self.__class__.__name__.lower()
return reverse('admin:seminar_{}_change'.format(model_name), args=(self.id, ))
def verejne_url(self):
return None
# def verejne_url(self):
# return None
@reversion.register(ignore_duplicates=True)
class Osoba(SeminarModelBase):
@ -642,7 +642,7 @@ class Cislo(SeminarModelBase):
def posli_cislo_mailem(self):
# parametry e-mailu
odkaz = self.get_absolute_url()
odkaz = self.verejne_url()
poslat_z_mailu = 'zadani@mam.mff.cuni.cz'
predmet = 'Vyšlo číslo {}'.format(self.kod())

Loading…
Cancel
Save