CHORE: Removed random prints and cleaned code

This commit is contained in:
Luke Else 2024-02-09 22:10:25 +00:00
parent 60cb8d7951
commit 9943a1492c
2 changed files with 1 additions and 3 deletions

View File

@ -70,13 +70,11 @@ class StatsController(DatabaseController):
key = datetime.today() - timedelta(days=i)
day_views[key.strftime('%b-%d')] = list()
print(list(day_views))
# Organise data into distinct
for view in filtered_data:
key = datetime.today() - (datetime.today() - view.viewDate)
day_views[key.strftime('%b-%d')].append(view)
print(list(day_views))
return day_views
def read_product_views(self, id: int):

View File

@ -76,8 +76,8 @@ def id(id: int):
# Record a view on the product
db = StatsController()
user_id = session.get('user_id')
print(user_id)
db.create(Stats(product.id, user_id))
return render_template(