Removed unnecessary check in BaseModelAdmin.get_view_on_site_url().

This commit is contained in:
Marco Richetta 2020-10-13 01:28:14 -03:00 committed by GitHub
parent 78ae8cc5d8
commit e92971ccb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -296,7 +296,7 @@ class BaseModelAdmin(metaclass=forms.MediaDefiningClass):
if callable(self.view_on_site): if callable(self.view_on_site):
return self.view_on_site(obj) return self.view_on_site(obj)
elif self.view_on_site and hasattr(obj, 'get_absolute_url'): elif hasattr(obj, 'get_absolute_url'):
# use the ContentType lookup if view_on_site is True # use the ContentType lookup if view_on_site is True
return reverse('admin:view_on_site', kwargs={ return reverse('admin:view_on_site', kwargs={
'content_type_id': get_content_type_for_model(obj).pk, 'content_type_id': get_content_type_for_model(obj).pk,