Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
b69641e0
authored
Apr 07, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: checking user when deleting group
parent
4d7140f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
circle/dashboard/tests/test_views.py
+2
-1
circle/dashboard/views.py
+2
-1
No files found.
circle/dashboard/tests/test_views.py
View file @
b69641e0
...
...
@@ -551,6 +551,7 @@ class GroupDetailTest(LoginMixin, TestCase):
self
.
u1
.
delete
()
self
.
u2
.
delete
()
self
.
us
.
delete
()
self
.
u3
.
delete
()
self
.
g1
.
delete
()
def
test_404_superuser_group_page
(
self
):
...
...
@@ -624,7 +625,7 @@ class GroupDetailTest(LoginMixin, TestCase):
c
=
Client
()
self
.
login
(
c
,
'user3'
)
response
=
c
.
post
(
'/dashboard/group/delete/1/'
)
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertEqual
(
Group
.
objects
.
count
(),
num_of_groups
)
def
test_acl_group_delete
(
self
):
...
...
circle/dashboard/views.py
View file @
b69641e0
...
...
@@ -1102,7 +1102,8 @@ class GroupDelete(CheckedDetailView, DeleteView):
# github.com/django/django/blob/master/django/views/generic/edit.py#L245
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
object
=
self
.
get_object
()
if
not
object
.
profile
.
has_level
(
request
.
user
,
'operator'
):
raise
PermissionDenied
()
object
.
delete
()
success_url
=
self
.
get_success_url
()
success_message
=
_
(
"Group successfully deleted!"
)
...
...
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