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
Commit
7f29f16e
authored
Apr 10, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix
#401
(Convert orgid to upper)
fixes
#401
parent
52f2a704
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
circle/dashboard/models.py
+2
-2
circle/dashboard/views/group.py
+1
-1
circle/dashboard/views/util.py
+1
-1
No files found.
circle/dashboard/models.py
View file @
7f29f16e
...
@@ -309,7 +309,7 @@ if hasattr(settings, 'SAML_ORG_ID_ATTRIBUTE'):
...
@@ -309,7 +309,7 @@ if hasattr(settings, 'SAML_ORG_ID_ATTRIBUTE'):
attributes
=
kwargs
.
pop
(
'attributes'
)
attributes
=
kwargs
.
pop
(
'attributes'
)
atr
=
settings
.
SAML_ORG_ID_ATTRIBUTE
atr
=
settings
.
SAML_ORG_ID_ATTRIBUTE
try
:
try
:
value
=
attributes
[
atr
][
0
]
value
=
attributes
[
atr
][
0
]
.
upper
()
except
Exception
as
e
:
except
Exception
as
e
:
value
=
None
value
=
None
logger
.
info
(
"save_org_id couldn't find attribute.
%
s"
,
unicode
(
e
))
logger
.
info
(
"save_org_id couldn't find attribute.
%
s"
,
unicode
(
e
))
...
@@ -339,7 +339,7 @@ if hasattr(settings, 'SAML_ORG_ID_ATTRIBUTE'):
...
@@ -339,7 +339,7 @@ if hasattr(settings, 'SAML_ORG_ID_ATTRIBUTE'):
group
,
unicode
(
g
))
group
,
unicode
(
g
))
g
.
user_set
.
add
(
sender
)
g
.
user_set
.
add
(
sender
)
for
i
in
FutureMember
.
objects
.
filter
(
org_id
=
value
):
for
i
in
FutureMember
.
objects
.
filter
(
org_id
__iexact
=
value
):
i
.
group
.
user_set
.
add
(
sender
)
i
.
group
.
user_set
.
add
(
sender
)
i
.
delete
()
i
.
delete
()
...
...
circle/dashboard/views/group.py
View file @
7f29f16e
...
@@ -146,7 +146,7 @@ class GroupDetailView(CheckedDetailView):
...
@@ -146,7 +146,7 @@ class GroupDetailView(CheckedDetailView):
self
.
object
.
user_set
.
add
(
entity
)
self
.
object
.
user_set
.
add
(
entity
)
except
User
.
DoesNotExist
:
except
User
.
DoesNotExist
:
if
saml_available
:
if
saml_available
:
FutureMember
.
objects
.
get_or_create
(
org_id
=
name
,
FutureMember
.
objects
.
get_or_create
(
org_id
=
name
.
upper
()
,
group
=
self
.
object
)
group
=
self
.
object
)
else
:
else
:
messages
.
warning
(
request
,
_
(
'User "
%
s" not found.'
)
%
name
)
messages
.
warning
(
request
,
_
(
'User "
%
s" not found.'
)
%
name
)
...
...
circle/dashboard/views/util.py
View file @
7f29f16e
...
@@ -70,7 +70,7 @@ def search_user(keyword):
...
@@ -70,7 +70,7 @@ def search_user(keyword):
return
User
.
objects
.
get
(
username
=
keyword
)
return
User
.
objects
.
get
(
username
=
keyword
)
except
User
.
DoesNotExist
:
except
User
.
DoesNotExist
:
try
:
try
:
return
User
.
objects
.
get
(
profile__org_id
=
keyword
)
return
User
.
objects
.
get
(
profile__org_id
__iexact
=
keyword
)
except
User
.
DoesNotExist
:
except
User
.
DoesNotExist
:
return
User
.
objects
.
get
(
email
=
keyword
)
return
User
.
objects
.
get
(
email
=
keyword
)
...
...
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