From 1b908508186e4acb44650161d426c0408b2fa902 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 22 Jul 2018 21:06:16 -0700 Subject: [PATCH] Oops, add the required_feature decorators to remove_child. --- etiquette/objects.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index 6056055..2a2def3 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -284,8 +284,7 @@ class Album(ObjectBase, GroupableMixin): @decorators.required_feature('album.edit') # GroupableMixin.add_child already has @transaction. def add_child(self, *args, **kwargs): - result = super().add_child(*args, **kwargs) - return result + return super().add_child(*args, **kwargs) @decorators.required_feature('album.edit') # GroupableMixin.add_children already has @transaction. @@ -471,6 +470,11 @@ class Album(ObjectBase, GroupableMixin): ) return rel_row is not None + @decorators.required_feature('album.edit') + # GroupableMixin.remove_child already has @transaction. + def remove_child(self, *args, **kwargs): + return super().remove_child(*args, **kwargs) + def _remove_photo(self, photo): self.photodb.log.debug('Removing photo %s from %s', photo, self) pairs = {'albumid': self.id, 'photoid': photo.id} @@ -1344,6 +1348,11 @@ class Tag(ObjectBase, GroupableMixin): def leave_group(self, *args, **kwargs): return super().leave_group(*args, **kwargs) + @decorators.required_feature('tag.edit') + # GroupableMixin.remove_child already has @transaction. + def remove_child(self, *args, **kwargs): + return super().remove_child(*args, **kwargs) + @decorators.required_feature('tag.edit') @decorators.transaction def remove_synonym(self, synname, *, commit=True):