fix in style settings color validation

This commit is contained in:
Anand Doshi 2013-03-12 18:20:06 +05:30
parent 06ae34b015
commit e5c395f8b6

View File

@ -53,11 +53,13 @@ class DocType:
del self.doc.fields[f] del self.doc.fields[f]
def validate_colors(self): def validate_colors(self):
if self.doc.page_background==self.doc.page_text: if (self.doc.page_background or self.doc.page_text) and \
self.doc.page_background==self.doc.page_text:
webnotes.msgprint(_("Page text and background is same color. Please change."), webnotes.msgprint(_("Page text and background is same color. Please change."),
raise_exception=1) raise_exception=1)
if self.doc.top_bar_background==self.doc.top_bar_foreground: if (self.doc.top_bar_background or self.doc.top_bar_foreground) and \
self.doc.top_bar_background==self.doc.top_bar_foreground:
webnotes.msgprint(_("Top Bar text and background is same color. Please change."), webnotes.msgprint(_("Top Bar text and background is same color. Please change."),
raise_exception=1) raise_exception=1)