Verified Commit e06d19b3 authored by Karel Koci's avatar Karel Koci 🤘

supervisor: Change API for approvals enable

parent a8489ebe
......@@ -159,7 +159,7 @@ def _approved():
with open(const.APPROVALS_STAT_FILE, 'r') as file:
cols = file.readline().split(' ')
auto_grant_time = autorun.auto_approve_time()
if cols[1].strip() == 'granted' or (auto_grant_time is not None and int(cols[2]) < (time.time() - (auto_grant_time * 3600))):
if cols[1].strip() == 'granted' or (auto_grant_time > 0 and int(cols[2]) < (time.time() - (auto_grant_time * 3600))):
return cols[0]
return None
......
......@@ -78,7 +78,7 @@ def auto_approve_time():
value = int(uci.get("updater", "autorun", "auto_approve_time"))
return value if value > 0 else None
except UciExceptionNotFound:
return None
return 0
def set_auto_approve_time(approve_time):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment