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
edx
django-wiki
Commits
5f58fdf1
Commit
5f58fdf1
authored
Nov 16, 2014
by
Christian Duvholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear cache for article when doing something with attachments
parent
25e8a477
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
wiki/plugins/attachments/views.py
+6
-1
No files found.
wiki/plugins/attachments/views.py
View file @
5f58fdf1
...
...
@@ -50,6 +50,7 @@ class AttachmentView(ArticleMixin, FormView):
messages
.
success
(
self
.
request
,
_
(
'Successfully added:
%
s'
)
%
(
", "
.
join
([
ar
.
get_filename
()
for
ar
in
attachment_revision
])))
else
:
messages
.
success
(
self
.
request
,
_
(
'
%
s was successfully added.'
)
%
attachment_revision
.
get_filename
())
self
.
article
.
clear_cache
()
return
redirect
(
"wiki:attachments_index"
,
path
=
self
.
urlpath
.
path
,
article_id
=
self
.
article
.
id
)
...
...
@@ -122,6 +123,7 @@ class AttachmentReplaceView(ArticleMixin, FormView):
self
.
attachment
.
current_revision
=
attachment_revision
self
.
attachment
.
save
()
messages
.
success
(
self
.
request
,
_
(
'
%
s uploaded and replaces old attachment.'
)
%
attachment_revision
.
get_filename
())
self
.
article
.
clear_cache
()
except
models
.
IllegalFileExtension
as
e
:
messages
.
error
(
self
.
request
,
_
(
'Your file could not be saved:
%
s'
)
%
e
)
return
redirect
(
"wiki:attachments_replace"
,
attachment_id
=
self
.
attachment
.
id
,
...
...
@@ -203,6 +205,7 @@ class AttachmentChangeRevisionView(ArticleMixin, View):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
attachment
.
current_revision
=
self
.
revision
self
.
attachment
.
save
()
self
.
article
.
clear_cache
()
messages
.
success
(
self
.
request
,
_
(
'Current revision changed for
%
s.'
)
%
self
.
attachment
.
original_filename
)
return
redirect
(
"wiki:attachments_index"
,
path
=
self
.
urlpath
.
path
,
article_id
=
self
.
article
.
id
)
...
...
@@ -222,6 +225,7 @@ class AttachmentAddView(ArticleMixin, View):
if
not
self
.
attachment
.
articles
.
filter
(
id
=
self
.
article
.
id
):
self
.
attachment
.
articles
.
add
(
self
.
article
)
self
.
attachment
.
save
()
self
.
article
.
clear_cache
()
messages
.
success
(
self
.
request
,
_
(
'Added a reference to "
%(att)
s" from "
%(art)
s".'
)
%
{
'att'
:
self
.
attachment
.
original_filename
,
'art'
:
self
.
article
.
current_revision
.
title
})
...
...
@@ -252,11 +256,12 @@ class AttachmentDeleteView(ArticleMixin, FormView):
revision
.
save
()
self
.
attachment
.
current_revision
=
revision
self
.
attachment
.
save
()
self
.
article
.
clear_cache
()
messages
.
info
(
self
.
request
,
_
(
'The file
%
s was deleted.'
)
%
self
.
attachment
.
original_filename
)
else
:
self
.
attachment
.
articles
.
remove
(
self
.
article
)
messages
.
info
(
self
.
request
,
_
(
'This article is no longer related to the file
%
s.'
)
%
self
.
attachment
.
original_filename
)
self
.
article
.
clear_cache
()
return
redirect
(
"wiki:get"
,
path
=
self
.
urlpath
.
path
,
article_id
=
self
.
article
.
id
)
def
get_context_data
(
self
,
**
kwargs
):
...
...
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