Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
f7bfd6da
Commit
f7bfd6da
authored
Dec 08, 2015
by
Skia
Browse files
Add getattribute to PageRev for getting owner_group&co
parent
aa732a4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/models.py
View file @
f7bfd6da
...
...
@@ -315,6 +315,16 @@ class PageRev(models.Model):
def
__str__
(
self
):
return
str
(
self
.
__dict__
)
def
__getattribute__
(
self
,
attr
):
if
attr
==
"owner_group"
:
return
self
.
page
.
owner_group
elif
attr
==
"edit_group"
:
return
self
.
page
.
edit_group
elif
attr
==
"view_group"
:
return
self
.
page
.
view_group
else
:
return
object
.
__getattribute__
(
self
,
attr
)
def
save
(
self
,
*
args
,
**
kwargs
):
super
(
PageRev
,
self
).
save
(
*
args
,
**
kwargs
)
# Don't forget to unlock, otherwise, people will have to wait for the page's timeout
...
...
Write
Preview
Supports
Markdown
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