Replace more direct sql commits with PhotoDB commits
This commit is contained in:
		
							parent
							
								
									8692d826c5
								
							
						
					
					
						commit
						440941077f
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		|  | @ -362,7 +362,7 @@ class Bookmark(ObjectBase): | |||
|         cur = self.photodb.sql.cursor() | ||||
|         cur.execute('DELETE FROM bookmarks WHERE id == ?', [self.id]) | ||||
|         if commit: | ||||
|             self.photodb.sql.commit() | ||||
|             self.photodb.commit() | ||||
| 
 | ||||
|     def edit(self, title=None, url=None, *, commit=True): | ||||
|         if title is None and url is None: | ||||
|  | @ -381,7 +381,7 @@ class Bookmark(ObjectBase): | |||
|         ) | ||||
|         if commit: | ||||
|             self.photodb.log.debug('Committing - edit bookmark') | ||||
|             self.photodb.sql.commit() | ||||
|             self.photodb.commit() | ||||
| 
 | ||||
| 
 | ||||
| class Photo(ObjectBase): | ||||
|  |  | |||
|  | @ -362,7 +362,7 @@ class PDBBookmarkMixin: | |||
|         bookmark = objects.Bookmark(self, data) | ||||
|         if commit: | ||||
|             self.log.debug('Committing - new Bookmark') | ||||
|             self.sql.commit() | ||||
|             self.commit() | ||||
|         return bookmark | ||||
| 
 | ||||
| 
 | ||||
|  | @ -503,7 +503,7 @@ class PDBPhotoMixin: | |||
|             photo.delete(commit=False) | ||||
|         if commit: | ||||
|             self.log.debug('Committing - purge deleted photos') | ||||
|             self.sql.commit() | ||||
|             self.commit() | ||||
| 
 | ||||
|     def purge_empty_albums(self, *, commit=True): | ||||
|         albums = self.get_albums() | ||||
|  | @ -513,7 +513,7 @@ class PDBPhotoMixin: | |||
|             album.delete(commit=False) | ||||
|         if commit: | ||||
|             self.log.debug('Committing - purge empty albums') | ||||
|             self.sql.commit() | ||||
|             self.commit() | ||||
| 
 | ||||
|     def search( | ||||
|             self, | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue