Added validation for timezones

This commit is contained in:
pranav nachnekar 2019-09-03 12:04:23 +05:30
parent ad6151b690
commit eb4fa966b0

View File

@ -3,8 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
import frappe
from frappe.model.document import Document
class Timezone(Document):
pass
def validate(self):
if self.offset > 720 or self.offset < -720:
frappe.throw(
'Timezone offsets must be between -720 and +720 minutes')