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

Loading…
Cancel
Save