diff --git a/seminar/models/base.py b/seminar/models/base.py index 1069f165..48226973 100644 --- a/seminar/models/base.py +++ b/seminar/models/base.py @@ -14,8 +14,9 @@ class SeminarModelBase(models.Model): # return "https://" + str(get_current_site(None)) + self.verejne_url() def admin_url(self): + app_name = self._meta.app_label model_name = self.__class__.__name__.lower() - return reverse('admin:seminar_{}_change'.format(model_name), args=(self.id, )) + return reverse('admin:{}_{}_change'.format(app_name, model_name), args=(self.id, )) # def verejne_url(self): # return None diff --git a/tvorba/models.py b/tvorba/models.py index fd7a62da..f06edfe1 100644 --- a/tvorba/models.py +++ b/tvorba/models.py @@ -522,7 +522,7 @@ class Problem(SeminarModelBase,PolymorphicModel): return reverse('seminar_problem', kwargs={'pk': self.id}) def admin_url(self): - return reverse('admin:seminar_problem_change', args=(self.id, )) + return reverse('admin:tvorba_problem_change', args=(self.id, )) @cached_property def hlavni_problem(self):