Skip to content
Snippets Groups Projects
Commit 3f0eef29 authored by istmxrein's avatar istmxrein
Browse files

fix bug error comparing timestamps & bump to 1.5.7

parent e60b1e8d
Branches assignment_2
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import threading
import traceback
from collections import Counter
from datetime import datetime
from zoneinfo import ZoneInfo
from typing import List, Callable, Optional, Dict
import pika
......@@ -283,7 +284,7 @@ def get_active_users(cube_id: int):
if not res_thread:
raise RuntimeError("Reservation consumer is not initialized")
if res and res.endtime > datetime.utcnow():
if res and res.endtime > datetime.utcnow().replace(tzinfo=ZoneInfo('UTC')):
return [*res.extraUsers, res.owner]
else:
return []
......@@ -294,7 +295,7 @@ def get_active_reservation(cube_id: int):
if not res_thread:
raise RuntimeError("Reservation consumer is not initialized")
if res and res.endtime > datetime.utcnow():
if res and res.endtime > datetime.utcnow().replace(tzinfo=ZoneInfo('UTC')):
return res
else:
return None
......
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='pilab',
version='1.5.6',
version='1.5.7',
description='Shared-Libs for the pi-lab microservices',
url='https://code.fbi.h-da.de/api/v4/projects/27896/packages/pypi/pilab',
author='Max Reinheimer',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment