From 94d291da6d86d561a0e3676b8d823f39c1839d87 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 16 Mar 2018 23:42:40 +0530 Subject: [PATCH] model views refactor --- datacenterlight/cms_models.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index 6d394f0f..a424c27c 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -132,16 +132,12 @@ class DCLNavbarPluginModel(CMSPlugin): logo_url = models.URLField(max_length=300, null=True, blank=True) def get_logo_dark(self): - if self.logo_dark: - return self.logo_dark.url - else: - return self.logo_white.url + # used only if atleast one logo exists + return self.logo_dark.url if self.logo_dark else self.logo_white.url def get_logo_light(self): - if self.logo_light: - return self.logo_light.url - else: - return self.logo_dark.url + # used only if atleast one logo exists + return self.logo_light.url if self.logo_light else self.logo_dark.url class DCLNavbarDropdownPluginModel(CMSPlugin):