summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-09-05 11:28:11 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-09-05 11:28:11 +0200
commitff164c5394037789e39bdffa8b1d55d4d0efdb5b (patch)
treef97bdfa7e93933278c3ca367c71a09d6e05b01f3 /ishtar_common
parentb6464968770440dc73816c857b064bc9f7af2fd4 (diff)
downloadIshtar-ff164c5394037789e39bdffa8b1d55d4d0efdb5b.tar.bz2
Ishtar-ff164c5394037789e39bdffa8b1d55d4d0efdb5b.zip
Fix display of organizations in person tables
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py15
-rw-r--r--ishtar_common/views.py2
2 files changed, 11 insertions, 6 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 4f1168d39..1656b1e64 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2695,9 +2695,9 @@ class Person(Address, Merge, OwnPerms, ValueGetter):
('Dr', _(u'Doctor')),
)
TABLE_COLS = ('name', 'surname', 'raw_name', 'email', 'person_types_list',
- 'attached_to__name', 'town')
+ 'attached_to', 'town')
TABLE_COLS_ACCOUNT = ('name', 'surname', 'raw_name', 'email',
- 'profiles_list', 'attached_to__name', 'town')
+ 'profiles_list', 'attached_to', 'town')
SHOW_URL = 'show-person'
MODIFY_URL = 'person_modify'
BASE_SEARCH_VECTORS = ['name', 'surname', 'raw_name', 'town',
@@ -2706,11 +2706,11 @@ class Person(Address, Merge, OwnPerms, ValueGetter):
# search parameters
REVERSED_BOOL_FIELDS = ['ishtaruser__isnull']
EXTRA_REQUEST_KEYS = {
- 'attached_to__name': 'attached_to__name',
'ishtaruser__isnull': 'ishtaruser__isnull',
+ 'attached_to': 'attached_to',
}
COL_LABELS = {
- 'attached_to__name': _(u"Organization")
+ 'attached_to': _(u"Organization")
}
# alternative names of fields for searches
@@ -3092,7 +3092,7 @@ post_save.connect(post_save_userprofile, sender=UserProfile)
class IshtarUser(FullSearch):
TABLE_COLS = ('username', 'person__name', 'person__surname',
'person__email', 'person__person_types_list',
- 'person__attached_to')
+ 'person__attached_to__name')
BASE_SEARCH_VECTORS = [
'user_ptr__username', 'person__name', 'person__surname',
'person__email', 'person__town', 'person__attached_to__name']
@@ -3102,6 +3102,11 @@ class IshtarUser(FullSearch):
'person__person_types_list': 'person__person_types__label'
}
+ COL_LABELS = {
+ 'person__attached_to__name': _(u"Organization"),
+ 'username': _(u"Username")
+ }
+
# alternative names of fields for searches
ALT_NAMES = {
'username': (
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 54af31cff..afc928147 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -596,7 +596,7 @@ def autocomplete_organization(request, orga_type=None):
q = request.GET.get('term')
query = Q()
for q in q.split(' '):
- extra = Q(name__icontains=q)
+ extra = Q(cached_label__icontains=q)
query = query & extra
if orga_type:
try: