Commit 711d1885 authored by Jelle Besseling's avatar Jelle Besseling
Browse files

Merge branch 'fix/generate-thumbnails-url' into 'master'

Change generate thumbnail url

See merge request !1173
parents 1eb74542 e79c567b
......@@ -128,7 +128,7 @@ urlpatterns = [ # pylint: disable=invalid-name
# Provide something to test error handling. Limited to admins.
url(r'crash/$', views.crash),
# Custom media paths
url(r'^media/(public|private)/generate-thumbnail/(?P<request_path>.*)', generate_thumbnail, name='generate-thumbnail'),
url(r'^media/generate-thumbnail/(?P<request_path>.*)', generate_thumbnail, name='generate-thumbnail'),
url(r'^media/private/(?P<request_path>.*)$', private_media, name='private-media')
] + static(settings.MEDIA_URL + 'public/',
document_root=os.path.join(settings.MEDIA_ROOT, 'public'))
......@@ -95,8 +95,7 @@ def get_thumbnail_url(path, size, fit=True):
# it means kicking off a new GET request. If we would generate all
# thumbnails inline, loading an album overview would have high latency.
return reverse('generate-thumbnail',
os.path.join(size_fit, sig_info["path"])]) + query
args=[os.path.join(size_fit, sig_info["path"])]) + query
if sig_info['visibility'] == 'private':
# Put all image info in signature for serve view
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment