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
3b55783d
Commit
3b55783d
authored
Apr 30, 2018
by
Gregory Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retire User from RevisionPluginRevision
EDUCATOR-2702
parent
a6bd51e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
.gitignore
+0
-2
setup.py
+8
-4
wiki/models/pluginbase.py
+12
-4
No files found.
.gitignore
View file @
3b55783d
...
...
@@ -33,5 +33,3 @@ virtualenv
*.swp
.idea/
.idea/vcs.xml
setup.py
View file @
3b55783d
...
...
@@ -2,11 +2,15 @@
import
os
from
setuptools
import
setup
,
find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def
read
(
fname
):
"""
Utility function to read the README file.
Used for the long_description. It's nice, because now 1) we have a top level
README file and 2) it's easier to type in the README file than to put a raw
string in below ...
"""
return
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
fname
))
.
read
()
...
...
wiki/models/pluginbase.py
View file @
3b55783d
...
...
@@ -198,8 +198,7 @@ class RevisionPluginRevision(BaseRevisionMixin, models.Model):
not
self
.
previous_revision
and
self
.
plugin
and
self
.
plugin
.
current_revision
and
self
.
plugin
.
current_revision
!=
self
):
self
.
plugin
.
current_revision
!=
self
):
self
.
previous_revision
=
self
.
plugin
.
current_revision
if
not
self
.
revision_number
:
...
...
@@ -216,6 +215,15 @@ class RevisionPluginRevision(BaseRevisionMixin, models.Model):
self
.
plugin
.
current_revision
=
self
self
.
plugin
.
save
()
@classmethod
def
retire_user
(
cls
,
user
):
"""
Updates a user record as a part of GDPR Phase II
:param user (obj)
:return: bool
"""
return
cls
.
objects
.
filter
(
user
=
user
)
.
update
(
ip_address
=
''
)
>
0
class
Meta
:
get_latest_by
=
'revision_number'
ordering
=
(
'-created'
,)
...
...
@@ -229,6 +237,7 @@ class RevisionPluginRevision(BaseRevisionMixin, models.Model):
# It's my art, when I disguise my body in the shape of a plane.
# (Shellac, 1993)
def
update_simple_plugins
(
instance
,
*
args
,
**
kwargs
):
"""Every time a new article revision is created, we update all active
plugins to match this article revision"""
...
...
@@ -237,4 +246,4 @@ def update_simple_plugins(instance, *args, **kwargs):
# TODO: This was breaking things. SimplePlugin doesn't have a revision?
p_revisions
.
update
(
article_revision
=
instance
)
signals
.
post_save
.
connect
(
update_simple_plugins
,
ArticleRevision
)
\ No newline at end of file
signals
.
post_save
.
connect
(
update_simple_plugins
,
ArticleRevision
)
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