check if stock is enabled in the auto update

This commit is contained in:
cupcakearmy 2019-12-23 01:46:29 +01:00
parent 03d2ed7aa3
commit 3a6f90ffec
2 changed files with 2 additions and 2 deletions

View File

@ -62,9 +62,10 @@ def send_update_to_user(user: str, auto, codes=None):
last_run = code_data[Section.LastRun.value] last_run = code_data[Section.LastRun.value]
frequency = parse(code_data[Section.Frequency.value]) frequency = parse(code_data[Section.Frequency.value])
interval = parse(code_data[Section.Interval.value]) interval = parse(code_data[Section.Interval.value])
enabled = code_data[Section.Enabled.value]
# print(code, last_run + frequency, now, last_run + frequency - now) # print(code, last_run + frequency, now, last_run + frequency - now)
if auto and last_run + frequency > now: if auto and (last_run + frequency > now or not enabled):
continue continue
code_data[Section.LastRun.value] = current_timestamp() code_data[Section.LastRun.value] = current_timestamp()

View File

@ -132,7 +132,6 @@ def single(update, context):
elif selected == BACK: elif selected == BACK:
return show_menu(update, context) return show_menu(update, context)
elif selected == ENABLED: elif selected == ENABLED:
print('Changing', wl[Section.Enabled.value])
wl[current][Section.Enabled.value] = not wl[current][Section.Enabled.value] wl[current][Section.Enabled.value] = not wl[current][Section.Enabled.value]
save_watchlist(context, wl) save_watchlist(context, wl)
return show_single(update, context) return show_single(update, context)