Add some more log debugs.
This commit is contained in:
		
							parent
							
								
									5fccf5548b
								
							
						
					
					
						commit
						178a7df0b3
					
				
					 2 changed files with 13 additions and 7 deletions
				
			
		|  | @ -248,8 +248,7 @@ class Album(ObjectBase, GroupableMixin): | |||
|         self._sum_bytes_recursive = None | ||||
|         parent = self.parent() | ||||
|         if parent is not None: | ||||
|             parent._sum_photos_recursive = None | ||||
|             parent._sum_bytes_recursive = None | ||||
|             parent._uncache_sums() | ||||
| 
 | ||||
|     @decorators.required_feature('album.edit') | ||||
|     def add_child(self, *args, **kwargs): | ||||
|  | @ -301,7 +300,8 @@ class Album(ObjectBase, GroupableMixin): | |||
|             raise ValueError('Not the same PhotoDB') | ||||
|         if self.has_photo(photo): | ||||
|             return | ||||
|         self.photodb.log.debug('Adding photo %s to %s' % (photo, self)) | ||||
| 
 | ||||
|         self.photodb.log.debug('Adding photo %s to %s', photo, self) | ||||
|         cur = self.photodb.sql.cursor() | ||||
|         cur.execute('INSERT INTO album_photo_rel VALUES(?, ?)', [self.id, photo.id]) | ||||
|         self._uncache_sums() | ||||
|  | @ -428,6 +428,8 @@ class Album(ObjectBase, GroupableMixin): | |||
|     def remove_photo(self, photo, *, commit=True): | ||||
|         if not self.has_photo(photo): | ||||
|             return | ||||
| 
 | ||||
|         self.photodb.log.debug('Removing photo %s from %s', photo, self) | ||||
|         cur = self.photodb.sql.cursor() | ||||
|         cur.execute( | ||||
|             'DELETE FROM album_photo_rel WHERE albumid == ? AND photoid == ?', | ||||
|  | @ -1061,7 +1063,6 @@ class Tag(ObjectBase, GroupableMixin): | |||
|     def add_synonym(self, synname, *, commit=True): | ||||
|         synname = self.photodb.normalize_tagname(synname) | ||||
| 
 | ||||
|         print(synname, self.name) | ||||
|         if synname == self.name: | ||||
|             raise exceptions.CantSynonymSelf() | ||||
| 
 | ||||
|  | @ -1072,6 +1073,8 @@ class Tag(ObjectBase, GroupableMixin): | |||
|         else: | ||||
|             raise exceptions.TagExists(existing_tag) | ||||
| 
 | ||||
|         self.log.debug('New synonym %s of %s', synname, self.name) | ||||
| 
 | ||||
|         self.photodb._cached_frozen_children = None | ||||
|         cur = self.photodb.sql.cursor() | ||||
|         cur.execute('INSERT INTO tag_synonyms VALUES(?, ?)', [synname, self.name]) | ||||
|  |  | |||
|  | @ -241,7 +241,7 @@ class PDBAlbumMixin: | |||
| 
 | ||||
|         cur = self.sql.cursor() | ||||
| 
 | ||||
|         self.log.debug('New Album: %s' % title) | ||||
|         self.log.debug('New Album: %s %s', album_id, title) | ||||
|         data = { | ||||
|             'id': album_id, | ||||
|             'title': title, | ||||
|  | @ -386,7 +386,7 @@ class PDBPhotoMixin: | |||
|             else: | ||||
|                 raise exceptions.PhotoExists(existing) | ||||
| 
 | ||||
|         self.log.debug('New Photo: %s' % filepath.absolute_path) | ||||
|         self.log.debug('New Photo: %s', filepath.absolute_path) | ||||
|         author_id = self.get_user_id_or_none(author) | ||||
| 
 | ||||
|         created = int(helpers.now()) | ||||
|  | @ -911,6 +911,8 @@ class PDBTagMixin: | |||
|         else: | ||||
|             raise exceptions.TagExists(existing_tag) | ||||
| 
 | ||||
|         self.log.debug('New Tag: %s', tagname) | ||||
| 
 | ||||
|         tagid = self.generate_id('tags') | ||||
|         self._cached_frozen_children = None | ||||
|         cur = self.sql.cursor() | ||||
|  | @ -1076,6 +1078,8 @@ class PDBUserMixin: | |||
|         else: | ||||
|             raise exceptions.UserExists(existing_user) | ||||
| 
 | ||||
|         self.log.debug('New User: %s', username) | ||||
| 
 | ||||
|         user_id = self.generate_user_id() | ||||
|         hashed_password = bcrypt.hashpw(password, bcrypt.gensalt()) | ||||
|         created = int(helpers.now()) | ||||
|  | @ -1389,7 +1393,6 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs | |||
|             synonym = tag.add_synonym(synonym) | ||||
|             note = ('new_synonym', '%s+%s' % (tag.name, synonym)) | ||||
|             output_notes.append(note) | ||||
|             print('New syn %s' % synonym) | ||||
|         return output_notes | ||||
| 
 | ||||
|     def generate_id(self, table): | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue