Skip to content

Commit

Permalink
Updated to calculate based on time of submission
Browse files Browse the repository at this point in the history
Requests after 5 PM are treated as next day
  • Loading branch information
joelbcastillo committed Mar 14, 2016
1 parent d84d26c commit 6d8fb44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public_records_portal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,12 @@ def set_due_date(self):
self.date_received = self.date_created
if self.extended == True:
self.due_date = cal.addbusdays(cal.adjust(self.date_received, FOLLOWING), int(app.config['DAYS_AFTER_EXTENSION']))
if self.date_received.hour > 17:
self.due_date = cal.addbusdays(self.due_date, 1)
else:
self.due_date = cal.addbusdays(cal.adjust(self.date_received, FOLLOWING), int(app.config['DAYS_TO_FULFILL']))
if self.date_received.hour > 17:
self.due_date = cal.addbusdays(self.due_date, 1)


def extension(self, days_after=int(app.config['DAYS_AFTER_EXTENSION']),
Expand Down

0 comments on commit 6d8fb44

Please sign in to comment.