Skip to content

Commit

Permalink
fixed time delta
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosNasayo committed Apr 19, 2024
1 parent 3fd1a71 commit 1ff7454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api_modules/suscribe_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get(self, userId=None):
adm3=Adm3.objects(id=watershed_info.adm3.id).first()
adm2=Adm2.objects(id=adm3.adm2.id).first()
adm1=Adm1.objects(id=adm2.adm1.id).first()
start_date = datetime.now() - timedelta(days=200)
start_date = datetime.now() - timedelta(days=50)
start_date = start_date.replace(hour=0, minute=0, second=0, microsecond=0)
last_monitored = Monitored.objects(waterpoint=waterpoint_info.id, date__gte=start_date).order_by('-date').limit(1).first()
date_formated = datetime.strptime(str(last_monitored.date), "%Y-%m-%d %H:%M:%S")
Expand Down

0 comments on commit 1ff7454

Please sign in to comment.