Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
585e44b7
authored
Nov 08, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
acl: set up warning on group/user not found
parent
7978a871
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
circle/dashboard/views.py
+6
-2
No files found.
circle/dashboard/views.py
View file @
585e44b7
...
...
@@ -4,10 +4,12 @@ import logging
import
re
from
django.contrib.auth.models
import
User
,
Group
from
django.contrib.messages
import
warning
from
django.core
import
signing
from
django.core.exceptions
import
PermissionDenied
from
django.core.urlresolvers
import
reverse
from
django.shortcuts
import
redirect
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.views.generic
import
TemplateView
,
DetailView
,
View
from
django.views.generic.detail
import
SingleObjectMixin
from
django.http
import
HttpResponse
...
...
@@ -102,8 +104,10 @@ class AclUpdateView(View, SingleObjectMixin):
entity
=
User
.
objects
.
get
(
username
=
name
)
except
User
.
DoesNotExist
:
entity
=
Group
.
objects
.
get
(
name
=
name
)
instance
.
set_level
(
entity
,
value
)
return
redirect
(
instance
)
except
Group
.
DoesNotExist
:
warning
(
request
,
_
(
'User or group "
%
s" not found.'
)
%
name
)
return
logger
.
info
(
"Set
%
s's new acl level for
%
s to
%
s by
%
s."
,
unicode
(
entity
),
unicode
(
instance
),
value
,
unicode
(
request
.
user
))
...
...
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