- {% trans "Selected user is:" %} {{ selected_user.first_name }} {{ selected_user.last_name }}
- {{ selected_user.email }}
-
- {% endif %}
-
diff --git a/combo/apps/usersearch/urls.py b/combo/apps/usersearch/urls.py
deleted file mode 100644
index 00e25775..00000000
--- a/combo/apps/usersearch/urls.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# combo - content management system
-# Copyright (C) 2014-2016 Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-
-from django.conf.urls import url
-
-from .views import ajax_usersearch
-
-urlpatterns = [
- url(r'^ajax/usersearch/$',
- ajax_usersearch, name='combo-ajax-usersearch'),
-]
diff --git a/combo/apps/usersearch/views.py b/combo/apps/usersearch/views.py
deleted file mode 100644
index 81d7286c..00000000
--- a/combo/apps/usersearch/views.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# combo - content management system
-# Copyright (C) 2014-2016 Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-
-import json
-
-from django.http import HttpResponse
-from django.contrib.auth.models import User
-from django.db.models import Q
-from django.core import serializers
-from django.core.exceptions import PermissionDenied
-
-from .models import UserSearchCell
-
-
-def ajax_usersearch(request):
- # allow access if the user can see at least one UserSearch cell
- for cell in UserSearchCell.objects.all():
- if cell.is_visible(request.user) and cell.page.is_visible(request.user):
- break
- else:
- raise PermissionDenied
- query = request.GET.get('q')
- if query:
- users = User.objects.all()
- # pseudo full-text search
- for elem in query.split():
- users = users.filter(Q(username__icontains=elem)
- |Q(first_name__icontains=elem)
- |Q(last_name__icontains=elem)
- |Q(email__icontains=elem))
- users = json.loads(serializers.serialize(
- 'json', users[:10], fields=('username', 'first_name', 'last_name', 'email')))
- else:
- users = []
- response = HttpResponse(content_type='application/json')
- json.dump(users, response, indent=2)
- return response
diff --git a/combo/settings.py b/combo/settings.py
index 8d2982e7..eb0f3d29 100644
--- a/combo/settings.py
+++ b/combo/settings.py
@@ -72,7 +72,6 @@ INSTALLED_APPS = (
'combo.apps.fargo',
'combo.apps.notifications',
'combo.apps.search',
- 'combo.apps.usersearch',
'combo.apps.maps',
'combo.apps.calendar',
'combo.apps.pwa',
@@ -345,7 +344,6 @@ PWA_NOTIFICATION_ICON_URL = None
BOOKING_CALENDAR_CELL_ENABLED = False
LEGACY_CHART_CELL_ENABLED = False
NEWSLETTERS_CELL_ENABLED = False
-USERSEARCH_CELL_ENABLED = False
local_settings_file = os.environ.get('COMBO_SETTINGS_FILE',
os.path.join(os.path.dirname(__file__), 'local_settings.py'))