Skip to content

Commit

Permalink
Merge pull request #237 from OnroerendErfgoed/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
claeyswo authored Oct 16, 2023
2 parents 5f6501c + d054c0b commit ed18975
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.2.6 (16-10-2023)
------------------

- Gateway terugplaatsen na serializen

1.2.5 (13-10-2023)
------------------

Expand Down
16 changes: 15 additions & 1 deletion crabpy/gateway/adressenregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


def setup_cache(cache_settings, gateway):

if cache_settings is None:
if not LONG_CACHE.is_configured:
LONG_CACHE.configure("dogpile.cache.null")
Expand All @@ -43,7 +44,20 @@ def serializer(value):
else:
if isinstance(value, GatewayObject):
value.gateway = None
return original_serializer(value)

# Create cached result without gateway
result = original_serializer(value)

# Set gateway back for the response of the cached method.
if isinstance(value, list):
for item in value:
if isinstance(item, GatewayObject):
item.gateway = gateway
else:
if isinstance(value, GatewayObject):
value.gateway = gateway

return result

def deserializer(value):
"""Add the gateway object after deserializing."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="crabpy",
version="1.2.5",
version="1.2.6",
description="Interact with geographical webservices by Informatie Vlaanderen.",
long_description=open("README.rst").read() + "\n\n" + open("CHANGES.rst").read(),
author="Onroerend Erfgoed",
Expand Down

0 comments on commit ed18975

Please sign in to comment.