Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
27051f2a
Verified
Commit
27051f2a
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Set user in all revisions to allow further tracking
parent
172f4ee9
No related branches found
No related tags found
1 merge request
!385
Resolve "Replace django-easy-audit"
Pipeline
#4723
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/views.py
+5
-0
5 additions, 0 deletions
aleksis/core/views.py
with
5 additions
and
0 deletions
aleksis/core/views.py
+
5
−
0
View file @
27051f2a
...
...
@@ -17,6 +17,7 @@ from haystack.inputs import AutoQuery
from
haystack.query
import
SearchQuerySet
from
haystack.views
import
SearchView
from
health_check.views
import
MainView
from
reversion
import
set_user
from
rules.contrib.views
import
PermissionRequiredMixin
,
permission_required
from
.filters
import
GroupFilter
,
PersonFilter
...
...
@@ -308,6 +309,7 @@ def edit_person(request: HttpRequest, id_: Optional[int] = None) -> HttpResponse
if
request
.
method
==
"
POST
"
:
if
edit_person_form
.
is_valid
():
with
reversion
.
create_revision
():
set_user
(
request
.
user
)
edit_person_form
.
save
(
commit
=
True
)
messages
.
success
(
request
,
_
(
"
The person has been saved.
"
))
...
...
@@ -344,6 +346,7 @@ def edit_group(request: HttpRequest, id_: Optional[int] = None) -> HttpResponse:
if
request
.
method
==
"
POST
"
:
if
edit_group_form
.
is_valid
():
with
reversion
.
create_revision
():
set_user
(
request
.
user
)
group
=
edit_group_form
.
save
(
commit
=
True
)
messages
.
success
(
request
,
_
(
"
The group has been saved.
"
))
...
...
@@ -543,6 +546,7 @@ def delete_person(request: HttpRequest, id_: int) -> HttpResponse:
person
=
objectgetter_optional
(
Person
)(
request
,
id_
)
with
reversion
.
create_revision
():
set_user
(
request
.
user
)
person
.
save
()
person
.
delete
()
...
...
@@ -556,6 +560,7 @@ def delete_group(request: HttpRequest, id_: int) -> HttpResponse:
"""
View to delete an group.
"""
group
=
objectgetter_optional
(
Group
)(
request
,
id_
)
with
reversion
.
create_revision
():
set_user
(
request
.
user
)
group
.
save
()
group
.
delete
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment