Added uniqueness check for offset

This commit is contained in:
Pranav Nachanekar 2019-09-11 14:59:25 +05:30
parent e543fc483f
commit 249cdd92e0

View File

@ -12,3 +12,6 @@ class Timezone(Document):
if self.offset > 720 or self.offset < -720:
frappe.throw(
'Timezone offsets must be between -720 and +720 minutes')
if frappe.db.exists({'doctype':'Timezone','offset':self.offset}):
frappe.throw(
'Timezone offsets need to be unique')