Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
concrexit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
70
Issues
70
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
thalia
concrexit
Commits
711d1885
Commit
711d1885
authored
Feb 20, 2019
by
Jelle Besseling
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/generate-thumbnails-url' into 'master'
Change generate thumbnail url See merge request
!1173
parents
1eb74542
e79c567b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
website/thaliawebsite/urls.py
website/thaliawebsite/urls.py
+1
-1
website/utils/media/services.py
website/utils/media/services.py
+1
-2
No files found.
website/thaliawebsite/urls.py
View file @
711d1885
...
...
@@ -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'
))
website/utils/media/services.py
View file @
711d1885
...
...
@@ -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'
,
args
=
[
sig_info
[
'visibility'
],
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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