refactor: code cleanup

minor fixes for improving code quality
This commit is contained in:
Ankush Menat 2021-05-22 22:58:22 +05:30
parent 4a2dbd4885
commit ad58a8164a
No known key found for this signature in database
GPG Key ID: 8EA82E09BBD13AAF

View File

@ -201,7 +201,7 @@ class Item(WebsiteGenerator):
def make_route(self): def make_route(self):
if not self.route: if not self.route:
return cstr(frappe.db.get_value('Item Group', self.item_group, return cstr(frappe.db.get_value('Item Group', self.item_group,
'route')) + '/' + self.scrub((self.item_name if self.item_name else self.item_code) + '-' + random_string(5)) 'route')) + '/' + self.scrub((self.item_name or self.item_code) + '-' + random_string(5))
def validate_website_image(self): def validate_website_image(self):
if frappe.flags.in_import: if frappe.flags.in_import:
@ -256,7 +256,6 @@ class Item(WebsiteGenerator):
"attached_to_name": self.name "attached_to_name": self.name
}) })
except frappe.DoesNotExistError: except frappe.DoesNotExistError:
pass
# cleanup # cleanup
frappe.local.message_log.pop() frappe.local.message_log.pop()