Skip to content

Commit 56dda0c

Browse files
committed
fix: instead of convert to string, but to list
1 parent 1a2d0dd commit 56dda0c

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

martor/locale/en/LC_MESSAGES/django.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2020-11-01 13:57+0700\n"
11+
"POT-Creation-Date: 2021-03-10 08:32+0700\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -175,15 +175,15 @@ msgstr ""
175175
msgid "Markdown Guide (Help)"
176176
msgstr ""
177177

178-
#: views.py:21 views.py:35 views.py:36
178+
#: views.py:22 views.py:36 views.py:37
179179
msgid "Invalid request!"
180180
msgstr ""
181181

182-
#: views.py:74
182+
#: views.py:75
183183
#, python-format
184184
msgid "No users registered as `%(username)s` or user is unactived."
185185
msgstr ""
186186

187-
#: views.py:79
187+
#: views.py:80
188188
msgid "Validation Failed for field `username`"
189189
msgstr ""

martor/locale/id/LC_MESSAGES/django.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2020-11-01 13:57+0700\n"
11+
"POT-Creation-Date: 2021-03-10 08:32+0700\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -177,17 +177,17 @@ msgstr "Layar Penuh"
177177
msgid "Markdown Guide (Help)"
178178
msgstr "Bantuan Penggunaan Markdown"
179179

180-
#: views.py:21 views.py:35 views.py:36
180+
#: views.py:22 views.py:36 views.py:37
181181
msgid "Invalid request!"
182182
msgstr "Permintaan tidak valid"
183183

184-
#: views.py:74
184+
#: views.py:75
185185
#, python-format
186186
msgid "No users registered as `%(username)s` or user is unactived."
187187
msgstr ""
188188
"Tidak ada pengguna terdaftar sebagai `%(username)s` atau pengguna telah "
189189
"nonaktif."
190190

191-
#: views.py:79
191+
#: views.py:80
192192
msgid "Validation Failed for field `username`"
193193
msgstr "Validasi Gagal untuk field `username`"

martor/locale/tr/LC_MESSAGES/django.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2020-11-01 13:57+0700\n"
11+
"POT-Creation-Date: 2021-03-10 08:33+0700\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: Ozcan Yarimdunya <[email protected]>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -178,15 +178,15 @@ msgstr "Tam ekran"
178178
msgid "Markdown Guide (Help)"
179179
msgstr "Markdown Kılavuzu (Yardım)"
180180

181-
#: views.py:21 views.py:35 views.py:36
181+
#: views.py:22 views.py:36 views.py:37
182182
msgid "Invalid request!"
183183
msgstr "Geçersiz istek!"
184184

185-
#: views.py:74
185+
#: views.py:75
186186
#, python-format
187187
msgid "No users registered as `%(username)s` or user is unactived."
188188
msgstr "`%(username)s` kullanıcı kayıtlı değil veya aktif değil"
189189

190-
#: views.py:79
190+
#: views.py:80
191191
msgid "Validation Failed for field `username`"
192192
msgstr "`kullanıcı adı` alanı için doğrulama başarısız"

martor/views.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
import json
5-
64
from django.http import (HttpResponse, JsonResponse)
75
from django.utils.module_loading import import_string
86
from django.utils.translation import ugettext_lazy as _
@@ -70,8 +68,7 @@ def markdown_search_user(request):
7068
queries = {'%s__icontains' % User.USERNAME_FIELD: username}
7169
users = User.objects.filter(**queries).filter(is_active=True)
7270
if users.exists():
73-
usernames = users.values_list('username', flat=True)
74-
usernames = json.dumps(list(usernames))
71+
usernames = list(users.values_list('username', flat=True))
7572
response_data.update({'status': 200, 'data': usernames})
7673
return JsonResponse(response_data)
7774

0 commit comments

Comments
 (0)