model views refactor

This commit is contained in:
Arvind Tiwari 2018-03-16 23:42:40 +05:30
parent 648905421d
commit 94d291da6d

View file

@ -132,16 +132,12 @@ class DCLNavbarPluginModel(CMSPlugin):
logo_url = models.URLField(max_length=300, null=True, blank=True) logo_url = models.URLField(max_length=300, null=True, blank=True)
def get_logo_dark(self): def get_logo_dark(self):
if self.logo_dark: # used only if atleast one logo exists
return self.logo_dark.url return self.logo_dark.url if self.logo_dark else self.logo_white.url
else:
return self.logo_white.url
def get_logo_light(self): def get_logo_light(self):
if self.logo_light: # used only if atleast one logo exists
return self.logo_light.url return self.logo_light.url if self.logo_light else self.logo_dark.url
else:
return self.logo_dark.url
class DCLNavbarDropdownPluginModel(CMSPlugin): class DCLNavbarDropdownPluginModel(CMSPlugin):