Fixes deletion of lists
This commit is contained in:
@ -39,10 +39,15 @@ class RedisStore(ABC):
|
||||
|
||||
def remove_object_from_related_stores(self, obj, stores=None):
|
||||
"""remove an object from all stores"""
|
||||
# if the stoers are provided, the object can just be an id
|
||||
if stores and isinstance(obj, int):
|
||||
obj_id = obj
|
||||
else:
|
||||
obj_id = obj.id
|
||||
stores = self.get_stores_for_object(obj) if stores is None else stores
|
||||
pipeline = r.pipeline()
|
||||
for store in stores:
|
||||
pipeline.zrem(store, -1, obj.id)
|
||||
pipeline.zrem(store, -1, obj_id)
|
||||
pipeline.execute()
|
||||
|
||||
def bulk_add_objects_to_store(self, objs, store):
|
||||
|
Reference in New Issue
Block a user