Fix add_child prefer specific photo tags.
And by fix I mean the old code wasn't even calling the method.
This commit is contained in:
		
							parent
							
								
									400c255aea
								
							
						
					
					
						commit
						cc79a4945d
					
				
					 1 changed files with 13 additions and 9 deletions
				
			
		|  | @ -1447,8 +1447,8 @@ class Tag(ObjectBase, GroupableMixin): | ||||||
|     def _uncache(self): |     def _uncache(self): | ||||||
|         self.photodb.caches['tag'].remove(self.id) |         self.photodb.caches['tag'].remove(self.id) | ||||||
| 
 | 
 | ||||||
|     def _add_child(self, member): |     def __add_child(self, member): | ||||||
|         ret = super()._add_child(member) |         ret = super().add_child(member) | ||||||
|         if ret is BAIL: |         if ret is BAIL: | ||||||
|             return BAIL |             return BAIL | ||||||
| 
 | 
 | ||||||
|  | @ -1471,19 +1471,23 @@ class Tag(ObjectBase, GroupableMixin): | ||||||
| 
 | 
 | ||||||
|     @decorators.required_feature('tag.edit') |     @decorators.required_feature('tag.edit') | ||||||
|     @decorators.transaction |     @decorators.transaction | ||||||
|     def add_child(self, *args, **kwargs): |     def add_child(self, member): | ||||||
|         ret = super().add_child(*args, **kwargs) |         ret = self.__add_child(member) | ||||||
|         if ret is BAIL: |         if ret is BAIL: | ||||||
|             return |             return BAIL | ||||||
|  | 
 | ||||||
|         self.photodb.caches['tag_exports'].clear() |         self.photodb.caches['tag_exports'].clear() | ||||||
|         return ret |         return ret | ||||||
| 
 | 
 | ||||||
|     @decorators.required_feature('tag.edit') |     @decorators.required_feature('tag.edit') | ||||||
|     @decorators.transaction |     @decorators.transaction | ||||||
|     def add_children(self, *args, **kwargs): |     def add_children(self, members): | ||||||
|         ret = super().add_children(*args, **kwargs) |         bail = True | ||||||
|         if ret is BAIL: |         for member in members: | ||||||
|             return |             bail = (self.__add_child(member) is BAIL) and bail | ||||||
|  |         if bail: | ||||||
|  |             return BAIL | ||||||
|  | 
 | ||||||
|         self.photodb.caches['tag_exports'].clear() |         self.photodb.caches['tag_exports'].clear() | ||||||
|         return ret |         return ret | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue