diff options
author | Jordan Cook <jordan.cook@pioneer.com> | 2022-06-11 20:47:39 -0500 |
---|---|---|
committer | Jordan Cook <jordan.cook@pioneer.com> | 2022-06-11 20:47:39 -0500 |
commit | bf841322a495ba16f5ad682f7e7bf8461e18ac0b (patch) | |
tree | 1441832ee501b92409f0aa0dfe66bf52dfab8788 /requests_cache/serializers | |
parent | a78af0338d9b3a59c33c15e50cd54422ae7489b8 (diff) | |
download | requests-cache-bf841322a495ba16f5ad682f7e7bf8461e18ac0b.tar.gz |
Clean up SerializerPipeline.decode_content
Diffstat (limited to 'requests_cache/serializers')
-rw-r--r-- | requests_cache/serializers/pipeline.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/requests_cache/serializers/pipeline.py b/requests_cache/serializers/pipeline.py index 08e1cac..652c8f5 100644 --- a/requests_cache/serializers/pipeline.py +++ b/requests_cache/serializers/pipeline.py @@ -60,20 +60,11 @@ class SerializerPipeline: value = step(value) return value - # TODO: I don't love this. Could BaseStorage init be refactored to not need this getter/setter? - @property - def decode_content(self) -> bool: - for stage in self.stages: - if hasattr(stage, 'decode_content'): - return stage.decode_content - return False - - @decode_content.setter - def decode_content(self, value: bool): + def set_decode_content(self, decode_content: bool): """Set decode_content, if the pipeline contains a CattrStage or compatible object""" for stage in self.stages: if hasattr(stage, 'decode_content'): - stage.decode_content = value + stage.decode_content = decode_content def __str__(self) -> str: return f'SerializerPipeline(name={self.name}, n_stages={len(self.dump_stages)})' |