Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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
1ba46618
authored
Sep 09, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: rename AclUserAutocomplete
parent
229225d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
circle/dashboard/autocomplete_light_registry.py
+21
-2
No files found.
circle/dashboard/autocomplete_light_registry.py
View file @
1ba46618
...
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext as _
...
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext as _
from
.views
import
AclUpdateView
from
.views
import
AclUpdateView
class
AclUserAutocomplete
(
autocomplete_light
.
AutocompleteGenericBase
):
class
AclUser
Group
Autocomplete
(
autocomplete_light
.
AutocompleteGenericBase
):
search_fields
=
(
search_fields
=
(
(
'^first_name'
,
'last_name'
,
'username'
,
'^email'
,
'profile__org_id'
),
(
'^first_name'
,
'last_name'
,
'username'
,
'^email'
,
'profile__org_id'
),
(
'^name'
,
'groupprofile__org_id'
),
(
'^name'
,
'groupprofile__org_id'
),
...
@@ -27,7 +27,26 @@ class AclUserAutocomplete(autocomplete_light.AutocompleteGenericBase):
...
@@ -27,7 +27,26 @@ class AclUserAutocomplete(autocomplete_light.AutocompleteGenericBase):
user
=
self
.
request
.
user
user
=
self
.
request
.
user
self
.
choices
=
(
AclUpdateView
.
get_allowed_users
(
user
),
self
.
choices
=
(
AclUpdateView
.
get_allowed_users
(
user
),
AclUpdateView
.
get_allowed_groups
(
user
))
AclUpdateView
.
get_allowed_groups
(
user
))
return
super
(
AclUserAutocomplete
,
self
)
.
choices_for_request
()
return
super
(
AclUser
Group
Autocomplete
,
self
)
.
choices_for_request
()
def
autocomplete_html
(
self
):
html
=
[]
for
choice
in
self
.
choices_for_request
():
html
.
append
(
self
.
choice_html
(
choice
))
if
not
html
:
html
=
self
.
empty_html_format
%
_
(
'no matches found'
)
.
capitalize
()
return
self
.
autocomplete_html_format
%
''
.
join
(
html
)
class
AclUserAutocomplete
(
AclUserGroupAutocomplete
):
def
choices_for_request
(
self
):
user
=
self
.
request
.
user
self
.
choices
=
(
AclUpdateView
.
get_allowed_users
(
user
),
)
return
super
(
AclUserGroupAutocomplete
,
self
)
.
choices_for_request
()
autocomplete_light
.
register
(
AclUserGroupAutocomplete
)
autocomplete_light
.
register
(
AclUserAutocomplete
)
autocomplete_light
.
register
(
AclUserAutocomplete
)
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