Add more items to to-do list; minor fixes.

This commit is contained in:
voussoir 2018-02-20 16:50:39 -08:00
parent ebe0fcee40
commit 13e8bc4a6f
5 changed files with 12 additions and 4 deletions

View file

@ -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.

View file

@ -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

View file

@ -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))

View file

@ -212,7 +212,7 @@
</ul>
{% endif %}
<a href="/search?created=-{{photo.created}}">&larr;Before</a><span> | </span><a href="/search?created={{photo.created}}-">After&rarr;</a>
<a href="/search?created=-{{photo.created}}">&larr;Before</a><span> | </span><a href="/search?created={{photo.created}}-&orderby=created-asc">After&rarr;</a>
</div>
<div id="message_area_bg">
<div id="message_area">

View file

@ -21,6 +21,7 @@ body
#content_body
{
flex: 1;
word-break: break-word;
}
#left
{