diff --git a/README.md b/README.md index c7c2f50..53687a0 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,11 @@ If you are interested in helping, please raise an issue before making any pull r - Perhaps instead of actually deleting objects, they should just have a `deleted` flag, to make easy restoration possible. Also consider regrouping the children of restored Groupables if those children haven't already been reassigned somewhere else. - Add a new table to store permanent history of add/remove of tags on photos, so that accidents or trolling can be reversed. - Improve transaction rollbacking. I'm not satisfied with the @transaction decorator because sometimes I want to use exceptions as control flow without them rolling things back. Context managers are good but it's a matter of how abstracted they should be. +- Photo thumbnail paths should be relative to the data_dir, they are currently one level up. Or maybe should remove the paths entirely and just recalculate it by the ID. Can't think of any reason to have a thumbnail point elsewhere. +- Fix album size cache when photo reload metadata and generally improve that validation. +- Better bookmark url validation. +- Create a textbox which gives autocomplete tag names. +- Allow any div to get the clipboard size. Update via classname instead of ID. ### To do list: User permissions Here are some thoughts about the kinds of features that need to exist within the permission system. I don't know how I'll actually manage it just yet. Possibly a `permissions` table in the database with `user_id | permission` where `permission` is some reliably-formatted string. diff --git a/etiquette/decorators.py b/etiquette/decorators.py index 3df0e09..e264995 100644 --- a/etiquette/decorators.py +++ b/etiquette/decorators.py @@ -69,7 +69,6 @@ def transaction(method): return ret except Exception as e: self.log.debug('Rolling back') - print(e) self.sql.rollback() raise return wrapped diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 23adbbe..9cffd43 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -1183,7 +1183,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs item = self.get_tag(name=name) note = ('existing_tag', item.qualified_name()) except exceptions.NoSuchTag: - item = self.new_tag(name) + item = self.new_tag(name, commit=False) note = ('new_tag', item.qualified_name()) output_notes.append(note) return item @@ -1228,13 +1228,16 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs tags = [create_or_get(t) for t in tag_parts] for (higher, lower) in zip(tags, tags[1:]): try: - lower.join_group(higher) + lower.join_group(higher, commit=False) note = ('join_group', '%s.%s' % (higher.name, lower.name)) output_notes.append(note) except exceptions.GroupExists: pass tag = tags[-1] + self.log.debug('Committing - easybake') + self.commit() + if synonym: synonym = tag.add_synonym(synonym) note = ('new_synonym', '%s+%s' % (tag.name, synonym)) diff --git a/frontends/etiquette_flask/templates/photo.html b/frontends/etiquette_flask/templates/photo.html index 252c25b..5936fb0 100644 --- a/frontends/etiquette_flask/templates/photo.html +++ b/frontends/etiquette_flask/templates/photo.html @@ -212,7 +212,7 @@ {% endif %} - ←Before | After→ + ←Before | After→