Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
e79c567b
Verified
Commit
e79c567b
authored
Feb 20, 2019
by
Sébastiaan Versteeg
Browse files
change generate thumbnail url
parent
ab6161dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
website/thaliawebsite/urls.py
View file @
e79c567b
...
@@ -128,7 +128,7 @@ urlpatterns = [ # pylint: disable=invalid-name
...
@@ -128,7 +128,7 @@ urlpatterns = [ # pylint: disable=invalid-name
# Provide something to test error handling. Limited to admins.
# Provide something to test error handling. Limited to admins.
url
(
r
'crash/$'
,
views
.
crash
),
url
(
r
'crash/$'
,
views
.
crash
),
# Custom media paths
# 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'
)
url
(
r
'^media/private/(?P<request_path>.*)$'
,
private_media
,
name
=
'private-media'
)
]
+
static
(
settings
.
MEDIA_URL
+
'public/'
,
]
+
static
(
settings
.
MEDIA_URL
+
'public/'
,
document_root
=
os
.
path
.
join
(
settings
.
MEDIA_ROOT
,
'public'
))
document_root
=
os
.
path
.
join
(
settings
.
MEDIA_ROOT
,
'public'
))
website/utils/media/services.py
View file @
e79c567b
...
@@ -95,8 +95,7 @@ def get_thumbnail_url(path, size, fit=True):
...
@@ -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
# it means kicking off a new GET request. If we would generate all
# thumbnails inline, loading an album overview would have high latency.
# thumbnails inline, loading an album overview would have high latency.
return
reverse
(
'generate-thumbnail'
,
return
reverse
(
'generate-thumbnail'
,
args
=
[
sig_info
[
'visibility'
],
args
=
[
os
.
path
.
join
(
size_fit
,
sig_info
[
"path"
])])
+
query
os
.
path
.
join
(
size_fit
,
sig_info
[
"path"
])])
+
query
if
sig_info
[
'visibility'
]
==
'private'
:
if
sig_info
[
'visibility'
]
==
'private'
:
# Put all image info in signature for serve view
# Put all image info in signature for serve view
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment