Commit graph

988 commits

Author SHA1 Message Date
5d6c5ef2b4 Raise exception if attempted override name is invalid.
Technically it doesn't really matter because the override is not
used for any file ops, but I don't like the idea of busted
path-looking strings being displayed anywhere on the interface.
2018-02-17 15:47:26 -08:00
606a66cbf9 Remove Photo.filepath and real_filepath in favor of real_path. 2018-02-17 15:19:36 -08:00
42728d5d67 Add method Photo.set_override_filename. 2018-02-17 15:07:26 -08:00
f7bd49b2dd Add call to remove_control_chars in remove_bad_pathchars. 2018-02-17 15:07:12 -08:00
59cd922a53 Remove unnecessary methods=GET. 2018-02-17 14:59:02 -08:00
0d6faa8f6e Take advantage of new sql_update to update where_keys. 2018-02-17 14:02:11 -08:00
9939f5da1d For sql_insert / _update, let default commit=False.
Because all the calls are using it that way anyway.
2018-02-17 14:01:12 -08:00
cd4e970f04 Bump voussoirkit requirement to 0.0.20.
SQLHelpers can now update the where_key.
2018-02-17 13:48:56 -08:00
6363cb5fc0 Rename Album.associated_directories -> get_associated_directories. 2018-02-17 13:33:27 -08:00
574ac9f656 Slightly scale down image thumbnail to match others.
It was too big!
2018-02-16 23:30:27 -08:00
b4a28f5034 Make Photo.bytestring a @property.
This is the kind of thing that should be a @property, because
it's very low processing power and doesn't hit the database.
2018-02-16 23:16:02 -08:00
bbe392ac09 Rename Photo.author -> get_author; no longer a @property. 2018-02-16 23:11:25 -08:00
205c49c21f Rename Photo.albums -> get_containing_albums. 2018-02-16 23:08:44 -08:00
2f9b51b636 Rename Photo.tags -> get_tags. 2018-02-16 23:07:21 -08:00
ac9d7ede22 Rename Album.photos -> get_photos. 2018-02-16 23:03:54 -08:00
6574450ad1 Rename Tag.synonyms -> get_synonyms. 2018-02-16 23:01:07 -08:00
fdcf07940a Rename Groupable.children -> get_children. 2018-02-16 23:00:43 -08:00
75effafaf5 Rename Groupable.parent -> get_parent.
After making the "if x.parent is None" mistake too many times,
forgetting that it was not a @property, I've decided that the
verby name is better.
2018-02-16 22:59:34 -08:00
db92951ad6 Oops, remove incorrect name= from new_tag. 2018-02-16 22:57:35 -08:00
bf0ac1ebac Move etiquette_repl into a folder for consistency.
The items in the frontends folder should essentially be
black boxes with a launch file. Now the repl one looks the same
as the flask.
2018-02-16 22:31:10 -08:00
3c4f69f647 Specify name= on calls to PDB.get_tag.
Sometimes it's easy to forget whether its the name or ID,
and I like the consistency of specifying.
2018-02-16 22:25:56 -08:00
16ac6f8b85 Move UN / PW validation to helper _assert methods. 2018-02-16 22:18:19 -08:00
173c07a0bf Add some more exception hierarchy. Exists / InvalidUN/PW. 2018-02-16 22:13:54 -08:00
3944e1d862 Add CONTRIBUTING.md. 2018-02-16 21:54:22 -08:00
c6c7f51b15 Create new files for tests. Though still empty. 2018-02-16 21:45:36 -08:00
1c1e7f158f Minor fixes & pylint appeasements. 2018-02-16 21:28:36 -08:00
e5a316ff9c Remove old SQL_ constants. Use the dicts. 2018-02-16 20:40:58 -08:00
a8ead9c0c9 Replace a lot of manual insert/update with helper. 2018-02-16 20:19:18 -08:00
3e5031a1c5 Add methods sql_insert, sql_update to centralize sqlhelper work. 2018-02-16 18:49:02 -08:00
655d1fa235 Prepare to use dicts SQL_COLUMNS, _INDEX instead of separate. 2018-02-16 18:48:03 -08:00
4e8a67aa54 Avoid sql indexing by instantiating User earlier. 2018-02-16 18:40:57 -08:00
bc4e228a25 Remove a lot of the commented code from earlier search. 2018-02-04 15:11:46 -08:00
6f4530c88c Let SessionManager.get require Request object; Check IP addr.
So far there is no use case in which get needs to be called with
something other than a Request, and I don't think there will be.
So let's make that part of the design and we can also take the
opportunity to check IP.
2018-02-03 02:10:07 -08:00
c6a396c658 Move ef/endpoints/common.py to ef/common.py
Decided it doesn't belong with the endpoints files.
2018-02-03 01:43:41 -08:00
f7dcb489c5 Remove unnecessary intification of timestamps.
I decided I want to have higher precision especially because
batch inserts were having several photos with the same
created timestamp making orderby >= dumb.
2018-02-03 01:35:32 -08:00
b39f2e3f7b Create basic_endpoints file. Don't put them in __init__. 2018-02-03 01:34:07 -08:00
dec28b321a Rename recursive_dict_update's parameters for clarity. 2018-02-03 01:10:54 -08:00
f266e1c79c Split PhotoDB's large init into some smaller portions. 2018-02-03 01:10:04 -08:00
f9ee56187c Rename attr database_file to database_filepath.
To make it more consistent with config_filepath and show
that it's a path object.
2018-01-30 19:46:43 -08:00
20462f1085 Oops, add back missing CSS on mmf deleter. 2018-01-30 19:45:59 -08:00
06599df80b Update voussoirkit requirement to 0.0.19. 2018-01-30 19:45:21 -08:00
75953c2999 Add docstrings to the photoclipboard functions. 2018-01-19 22:24:07 -08:00
cf59f96813 Perform serverside expiration of sessions on get attempt.
Also remove unnecessary conversion to int.
2018-01-19 21:59:50 -08:00
cdd8f9e248 Only reload the page if the clip operation was successful. 2018-01-19 21:44:21 -08:00
b00d93901a Apply werkzeug ProxyFix so that request.remote_addr is correct. 2018-01-17 20:53:25 -08:00
7352d1e141 If the user has a token we don't recognize, give them a new one. 2018-01-15 20:04:47 -08:00
55e1281774 Improve technique for finding cookie set by function.
Instead of iterating through all the outgoing headers.
2018-01-15 18:56:41 -08:00
be0fca729f Create sessions for anons as well, instead of just logged in.
It makes sense that anon sessions are still sessions. So @give_token
will ensure that every request has a session. Logged in conditionals
move from 'if session' to 'if session.user'.
2018-01-15 18:41:21 -08:00
8a1f2c65f9 Tighten the types for _normalize_token; include werkzeug wrappers. 2018-01-15 18:39:40 -08:00
5e6f3d96b1 Remove localstorage from the todo list because that's done. 2018-01-13 20:06:53 -08:00