Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
5c3a4706
Commit
5c3a4706
authored
Apr 11, 2014
by
Antonin Lenfant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix image upload when IMAGE_PATH_OBSCURIFY setting is enabled
parent
ea3ef803
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
wiki/plugins/images/models.py
+2
-3
No files found.
wiki/plugins/images/models.py
View file @
5c3a4706
...
...
@@ -20,9 +20,8 @@ def upload_path(instance, filename):
upload_path
=
settings
.
IMAGE_PATH
upload_path
=
upload_path
.
replace
(
'
%
aid'
,
str
(
instance
.
plugin
.
image
.
article
.
id
))
if
settings
.
IMAGE_PATH_OBSCURIFY
:
import
random
,
hashlib
m
=
hashlib
.
md5
(
str
(
random
.
randint
(
0
,
100000000000000
)))
upload_path
=
os
.
path
.
join
(
upload_path
,
m
.
hexdigest
())
import
uuid
upload_path
=
os
.
path
.
join
(
upload_path
,
uuid
.
uuid4
()
.
hex
)
return
os
.
path
.
join
(
upload_path
,
filename
)
class
Image
(
RevisionPlugin
):
...
...
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