Skip to content

Commit 8f663c7

Browse files
authored
Merge pull request #1035 from mapswipe/feat/unaccent-usergroup-search
Feat/unaccent usergroup search
2 parents 9380c13 + d4805a0 commit 8f663c7

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

django/apps/existing_database/filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class UserGroupFilter:
3838
def filter_search(self, queryset):
3939
if self.search:
4040
queryset = queryset.filter(
41-
name__icontains=self.search,
41+
name__unaccent__icontains=self.search,
4242
)
4343
return queryset
4444

mapswipe_workers/tests/integration/set_up_db.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-- noinspection SqlNoDataSourceInspectionForFile
22
CREATE EXTENSION IF NOT EXISTS postgis;
3+
CREATE EXTENSION IF NOT EXISTS unaccent;
34

45
CREATE TABLE IF NOT EXISTS projects (
56
created timestamp,
@@ -30,7 +31,7 @@ CREATE TABLE IF NOT EXISTS groups (
3031
required_count int,
3132
progress int,
3233
project_type_specifics json,
33-
-- total_area & time_spent_max_allowed are maintaned and used by aggregated module
34+
-- total_area & time_spent_max_allowed are maintained and used by aggregated module
3435
total_area float DEFAULT NULL,
3536
time_spent_max_allowed float DEFAULT NULL,
3637
PRIMARY KEY (project_id, group_id),

postgres/initdb.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-- noinspection SqlNoDataSourceInspectionForFile
22
CREATE EXTENSION IF NOT EXISTS postgis;
3+
CREATE EXTENSION IF NOT EXISTS unaccent;
34

45
CREATE TABLE IF NOT EXISTS projects (
56
created timestamp,
@@ -30,7 +31,7 @@ CREATE TABLE IF NOT EXISTS groups (
3031
required_count int,
3132
progress int,
3233
project_type_specifics json,
33-
-- total_area & time_spent_max_allowed are maintaned and used by aggregated module
34+
-- total_area & time_spent_max_allowed are maintained and used by aggregated module
3435
total_area float DEFAULT NULL,
3536
time_spent_max_allowed float DEFAULT NULL,
3637
PRIMARY KEY (project_id, group_id),

0 commit comments

Comments
 (0)