Prevent exploitation of visit feature
parent
b9ef7c31bb
commit
ce268c0609
|
@ -231,6 +231,8 @@ class Plant(object):
|
||||||
self.visitors.append(element['user'])
|
self.visitors.append(element['user'])
|
||||||
if element['user'] not in visitors_this_check:
|
if element['user'] not in visitors_this_check:
|
||||||
visitors_this_check.append(element['user'])
|
visitors_this_check.append(element['user'])
|
||||||
|
# prevent users from manually setting watered_time in the future
|
||||||
|
if element['timestamp'] < int(time.time()):
|
||||||
if element['timestamp'] > latest_timestamp:
|
if element['timestamp'] > latest_timestamp:
|
||||||
latest_timestamp = element['timestamp']
|
latest_timestamp = element['timestamp']
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue