diff --git a/README.md b/README.md index 27b15ba..3cc53bc 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ Documentation is still a work in progress. In general, I use: - Debate whether the `UserMixin.login` method should accept usernames or I should standardize the usage of IDs only internally. - Album size is calculated every time you refresh the page. For large albums this is very slow. Consider caching? Or saving to db? - Organize the tag exporter functions better. +- Replace columns like area, ratio, bitrate by using [expression indices](https://sqlite.org/expridx.html) — `width * height` etc. +- Add some way to support large image albums without flooding the search results. Considering a "hidden" property so that a handful of representative images can appear in the search results, and the rest can be found on the actual Album page. ### Changelog diff --git a/etiquette/exceptions.py b/etiquette/exceptions.py index c52c4ba..7687b31 100644 --- a/etiquette/exceptions.py +++ b/etiquette/exceptions.py @@ -1,6 +1,9 @@ import re def pascal_to_loudsnakes(text): + ''' + NoSuchPhoto -> NO_SUCH_PHOTO + ''' match = re.findall('[A-Z][a-z]*', text) text = '_'.join(match) text = text.upper() diff --git a/etiquette_site.py b/etiquette_site.py index 7a58171..1a8e717 100644 --- a/etiquette_site.py +++ b/etiquette_site.py @@ -225,6 +225,10 @@ def post_login(): username = request.form['username'] password = request.form['password'] try: + # Consideration: Should the server hash the password to discourage + # information (user exists) leak via response time? + # Currently I think not, because they can check if the account + # page 404s anyway. user = P.get_user(username=username) user = P.login(user.id, password) except (exceptions.NoSuchUser, exceptions.WrongLogin): diff --git a/templates/photo.html b/templates/photo.html index e6989df..74107aa 100644 --- a/templates/photo.html +++ b/templates/photo.html @@ -148,7 +148,11 @@ {% set tags = photo.sorted_tags() %} {% for tag in tags %}