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
Valentin Samir
django-cas-server
Commits
1695cd24
Commit
1695cd24
authored
Jun 05, 2015
by
Valentin Samir
Browse files
filter attributs does not necessary exists
parent
02fd5572
Changes
1
Hide whitespace changes
Inline
Side-by-side
cas_server/models.py
View file @
1695cd24
...
@@ -175,8 +175,8 @@ class ServicePattern(models.Model):
...
@@ -175,8 +175,8 @@ class ServicePattern(models.Model):
if
self
.
restrict_users
and
not
self
.
usernames
.
filter
(
value
=
user
.
username
):
if
self
.
restrict_users
and
not
self
.
usernames
.
filter
(
value
=
user
.
username
):
raise
BadUsername
()
raise
BadUsername
()
for
filtre
in
self
.
filters
.
all
():
for
filtre
in
self
.
filters
.
all
():
if
isinstance
(
user
.
attributs
[
filtre
.
attribut
]
,
list
):
if
isinstance
(
user
.
attributs
.
get
(
filtre
.
attribut
,
[])
,
list
):
attrs
=
user
.
attributs
[
filtre
.
attribut
]
attrs
=
user
.
attributs
.
get
(
filtre
.
attribut
,
[])
else
:
else
:
attrs
=
[
user
.
attributs
[
filtre
.
attribut
]]
attrs
=
[
user
.
attributs
[
filtre
.
attribut
]]
for
value
in
attrs
:
for
value
in
attrs
:
...
...
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