From 61fd9de4774e564c0cd466519bbccdc8506ae8b8 Mon Sep 17 00:00:00 2001 From: yiorgos marinellis Date: Wed, 1 Apr 2020 19:56:09 +0200 Subject: [PATCH] Remove caching when returning lots, devices, fixes UI issue 18 --- ereuse_devicehub/resources/device/views.py | 6 +++--- ereuse_devicehub/resources/lot/views.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/resources/device/views.py b/ereuse_devicehub/resources/device/views.py index 1aaa1f93..2a7a5efd 100644 --- a/ereuse_devicehub/resources/device/views.py +++ b/ereuse_devicehub/resources/device/views.py @@ -92,7 +92,7 @@ class DeviceView(View): description: The device or devices. """ return super().get(id) - + def patch(self, id): dev = Device.query.filter_by(id=id).one() if isinstance(dev, Computer): @@ -109,7 +109,7 @@ class DeviceView(View): db.session.commit() return Response(status=204) raise ValueError('Cannot patch a non computer') - + def one(self, id: int): """Gets one device.""" if not request.authorization: @@ -127,7 +127,7 @@ class DeviceView(View): return self.schema.jsonify(device) @auth.Auth.requires_auth - @cache(datetime.timedelta(minutes=1)) + # @cache(datetime.timedelta(minutes=1)) def find(self, args: dict): """Gets many devices.""" # Compute query diff --git a/ereuse_devicehub/resources/lot/views.py b/ereuse_devicehub/resources/lot/views.py index 3e50070d..0a117c78 100644 --- a/ereuse_devicehub/resources/lot/views.py +++ b/ereuse_devicehub/resources/lot/views.py @@ -59,7 +59,7 @@ class LotView(View): lot = Lot.query.filter_by(id=id).one() # type: Lot return self.schema.jsonify(lot, nested=2) - @teal.cache.cache(datetime.timedelta(minutes=5)) + # @teal.cache.cache(datetime.timedelta(minutes=5)) def find(self, args: dict): """Gets lots.