Commit 109b69a8 authored by Kristian Tan's avatar Kristian Tan

Fixed if to record new entry

parent 20923a1f
...@@ -66,11 +66,11 @@ def create_entry(change_pin): ...@@ -66,11 +66,11 @@ def create_entry(change_pin):
print("LATEST ENTRY DATE: ") print("LATEST ENTRY DATE: ")
print(latest_entry_date) print(latest_entry_date)
latest_entry.kwhUsed += kwh latest_entry.kwhUsed += kwh
else: else:
print("NEW") print("NEW")
# If no entry for today, make one # If no entry for today, make one
entry = DailyUsage(date=start_date, kwhUsed=kwh) entry = DailyUsage(date=start_date, kwhUsed=kwh)
db.session.add(entry) db.session.add(entry)
db.session.commit() db.session.commit()
pins[change_pin]['on_time'] = None pins[change_pin]['on_time'] = None
pins[change_pin]['on_date'] = None pins[change_pin]['on_date'] = None
......
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