Apply suggestions from code review
Co-Authored-By: Shivam Mishra <scmmishra@users.noreply.github.com>
This commit is contained in:
parent
af18b2cdc5
commit
4d3dc87a1a
@ -23,12 +23,12 @@ class AppointmentBookingSettings(Document):
|
||||
to_time = datetime.datetime.strptime(
|
||||
self.min_date+record.to_time, self.format_string)
|
||||
timedelta = to_time-from_time
|
||||
self.from_time_is_later_than_to_time(from_time, to_time)
|
||||
self.validate_from_and_to_time(from_time, to_time)
|
||||
self.duration_is_divisible(from_time, to_time)
|
||||
|
||||
def from_time_is_later_than_to_time(self, from_time, to_time):
|
||||
def validate_from_and_to_time(self, from_time, to_time):
|
||||
if from_time > to_time:
|
||||
err_msg = 'From Time cannot be later than To Time for '+record.day_of_week
|
||||
err_msg = _(''<b>From Time</b> cannot be later than <b>To Time</b> for {0}'').format(record.day_of_week)
|
||||
frappe.throw(_(err_msg))
|
||||
|
||||
def duration_is_divisible(self, from_time, to_time):
|
||||
|
Loading…
Reference in New Issue
Block a user