minor visual fixes

master
voussoir 2017-03-02 16:56:18 -08:00
parent 9ba1a88174
commit 75ee476abf
4 changed files with 8 additions and 5 deletions

View File

@ -421,7 +421,6 @@ class PDBPhotoMixin:
Returns the Photo object. Returns the Photo object.
''' '''
filename = os.path.abspath(filename) filename = os.path.abspath(filename)
self.log.debug('New Photo: %s' % filename)
if not os.path.isfile(filename): if not os.path.isfile(filename):
raise FileNotFoundError(filename) raise FileNotFoundError(filename)
@ -435,6 +434,7 @@ class PDBPhotoMixin:
exc.photo = existing exc.photo = existing
raise exc raise exc
self.log.debug('New Photo: %s' % filename)
author_id = self.get_user_id_or_none(author) author_id = self.get_user_id_or_none(author)
extension = os.path.splitext(filename)[1] extension = os.path.splitext(filename)[1]
@ -1204,6 +1204,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs
albums = {directory.absolute_path: album} albums = {directory.absolute_path: album}
for (current_location, directories, files) in generator: for (current_location, directories, files) in generator:
# Create the photo object
new_photos = [] new_photos = []
for filepath in files: for filepath in files:
try: try:
@ -1215,6 +1216,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs
if not make_albums: if not make_albums:
continue continue
# Ensure that the current directory is an album.
current_album = albums.get(current_location.absolute_path, None) current_album = albums.get(current_location.absolute_path, None)
if current_album is None: if current_album is None:
try: try:
@ -1228,6 +1230,8 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs
self.log.debug('Created %s' % current_album.title) self.log.debug('Created %s' % current_album.title)
albums[current_location.absolute_path] = current_album albums[current_location.absolute_path] = current_album
# Add the current directory album to the parent directory album.
# Add the photos to the current album.
parent = albums.get(current_location.parent.absolute_path, None) parent = albums.get(current_location.parent.absolute_path, None)
if parent is not None: if parent is not None:
try: try:

View File

@ -103,7 +103,7 @@ def P_tag(tagname):
try: try:
return P.get_tag(tagname) return P.get_tag(tagname)
except exceptions.NoSuchTag as e: except exceptions.NoSuchTag as e:
return 'That tag doesnt exist: %s' % e return 'That tag doesnt exist: %s' % tagname
@P_wrapper @P_wrapper
def P_user(username): def P_user(username):
@ -122,7 +122,6 @@ def send_file(filepath, override_mimetype=None):
flask.abort(404) flask.abort(404)
outgoing_headers = {} outgoing_headers = {}
print(override_mimetype)
if override_mimetype is not None: if override_mimetype is not None:
mimetype = override_mimetype mimetype = override_mimetype
else: else:

View File

@ -171,7 +171,7 @@ li
.photo_card_grid_file_metadata .photo_card_grid_file_metadata
{ {
font-family: monospace; font-family: monospace;
font-size: 12px; font-size: 11px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
z-index: 0; z-index: 0;

View File

@ -226,7 +226,7 @@ function receive_callback(response)
if ("error" in response) if ("error" in response)
{ {
message_positivity = "message_negative"; message_positivity = "message_negative";
message_text = '"' + tagname + '" ' + response["error"]; message_text = response["error"];
} }
else else
{ {