mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Merge branch 'master' into refacto/vuejs_interface
This commit is contained in:
@@ -325,7 +325,7 @@ class AccountAPITestCase(ModoAPITestCase):
|
||||
self.assertEqual(user.language, "fr")
|
||||
|
||||
user.delete()
|
||||
data["language"] = "pl_PL"
|
||||
data["language"] = "pl"
|
||||
response = self.client.post(url, data, format="json")
|
||||
self.assertEqual(response.status_code, 201)
|
||||
account = response.json()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,20 +26,20 @@ LANGUAGES = (
|
||||
("cs", u"čeština"),
|
||||
("de", u"deutsch"),
|
||||
("en", u"english"),
|
||||
("el_GR", u"ελληνικά"),
|
||||
("el", u"ελληνικά"),
|
||||
("es", u"español"),
|
||||
("fr", u"français"),
|
||||
("it", u"italiano"),
|
||||
("ja_JP", u"日本の"),
|
||||
("ja", u"日本の"),
|
||||
("nl", u"nederlands"),
|
||||
("pt_PT", u"português"),
|
||||
("pt_BR", u"português (BR)"),
|
||||
("pl_PL", u"polski"),
|
||||
("ro_RO", u"Română"),
|
||||
("pt", u"português"),
|
||||
("pt-br", u"português (BR)"),
|
||||
("pl", u"polski"),
|
||||
("ro", u"Română"),
|
||||
("ru", u"русский"),
|
||||
("sv", u"svenska"),
|
||||
("tr_TR", u"türk"),
|
||||
("zh_TW", u"中文(台灣)"),
|
||||
("tr", u"türk"),
|
||||
("zh-hant", u"中文(台灣)"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ from django.contrib.auth import (
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
|
||||
from braces.forms import UserKwargModelFormMixin
|
||||
import django_otp
|
||||
|
||||
from modoboa.core.models import User
|
||||
from modoboa.lib.form_utils import UserKwargModelFormMixin
|
||||
from modoboa.parameters import tools as param_tools
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import logging
|
||||
|
||||
import oath
|
||||
|
||||
from django.http import HttpResponse, HttpResponseRedirect, Http404
|
||||
from django.http import (
|
||||
HttpResponse, HttpResponseRedirect, Http404, JsonResponse)
|
||||
from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from django.utils import translation
|
||||
@@ -17,15 +18,15 @@ from django.views.decorators.cache import never_cache
|
||||
from django.contrib.auth import (
|
||||
authenticate, login, logout, views as auth_views
|
||||
)
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.contrib.auth.tokens import default_token_generator
|
||||
|
||||
from braces.views import (
|
||||
JSONResponseMixin, LoginRequiredMixin, UserFormKwargsMixin)
|
||||
import django_otp
|
||||
|
||||
from modoboa.core import forms
|
||||
from modoboa.core.password_hashers import get_password_hasher
|
||||
from modoboa.lib import cryptutils
|
||||
from modoboa.lib.views import UserFormKwargsMixin
|
||||
from modoboa.parameters import tools as param_tools
|
||||
|
||||
from .. import models
|
||||
@@ -204,7 +205,7 @@ class VerifySMSCodeView(generic.FormView):
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
class ResendSMSCodeView(JSONResponseMixin, generic.View):
|
||||
class ResendSMSCodeView(generic.View):
|
||||
"""A view to resend validation code."""
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
@@ -230,7 +231,7 @@ class ResendSMSCodeView(JSONResponseMixin, generic.View):
|
||||
if not backend.send(text, [user.phone_number]):
|
||||
raise Http404
|
||||
self.request.session["totp_secret"] = secret
|
||||
return self.render_json_response({"status": "ok"})
|
||||
return JsonResponse({"status": "ok"})
|
||||
|
||||
|
||||
class TwoFactorCodeVerifyView(LoginRequiredMixin,
|
||||
|
||||
@@ -2,34 +2,37 @@
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Alessandro Fanna <alex@rospus.org>, 2021
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-05-06 13:15+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"PO-Revision-Date: 2020-05-11 18:45+0000\n"
|
||||
"Last-Translator: Alessandro Fanna <alex@rospus.org>, 2021\n"
|
||||
"Language-Team: Italian (https://www.transifex.com/tonio/teams/13749/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: it\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: ldapsync/lib.py:84
|
||||
msgid "Failed to create LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Impossibile creare un account LDAP: {}"
|
||||
|
||||
#: ldapsync/lib.py:124
|
||||
msgid "Failed to update LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Impossibile aggiornare l'account LDAP: {}"
|
||||
|
||||
#: ldapsync/lib.py:138
|
||||
msgid "Failed to delete LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Impossibile eliminare l'account LDAP: {}"
|
||||
|
||||
#: ldapsync/lib.py:149
|
||||
msgid "Failed to disable LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Impossibile disabilitare l'account LDAP: {}"
|
||||
|
||||
@@ -2,33 +2,37 @@
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Simona Iacob <s@zp1.net>, 2021
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-05-06 13:15+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"PO-Revision-Date: 2020-05-11 18:45+0000\n"
|
||||
"Last-Translator: Simona Iacob <s@zp1.net>, 2021\n"
|
||||
"Language-Team: Romanian (Romania) (https://www.transifex.com/tonio/teams/13749/ro_RO/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ro_RO\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
|
||||
|
||||
#: ldapsync/lib.py:84
|
||||
msgid "Failed to create LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Nu s-a reușit crearea unui cont LDAP: {}"
|
||||
|
||||
#: ldapsync/lib.py:124
|
||||
msgid "Failed to update LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Nu s-a reușit actualizarea contului LDAP: {}"
|
||||
|
||||
#: ldapsync/lib.py:138
|
||||
msgid "Failed to delete LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Nu s-a reușit ștergerea contului LDAP: {}"
|
||||
|
||||
#: ldapsync/lib.py:149
|
||||
msgid "Failed to disable LDAP account: {}"
|
||||
msgstr ""
|
||||
msgstr "Nu s-a reușit dezactivarea contului LDAP: {}"
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
# Translators:
|
||||
# Taras Havryliuk <admin@web4u.in.ua>, 2021
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-05-06 13:15+0200\n"
|
||||
"PO-Revision-Date: 2020-05-11 18:45+0000\n"
|
||||
"Last-Translator: Taras Havryliuk <admin@web4u.in.ua>, 2021\n"
|
||||
"Language-Team: Ukrainian (https://www.transifex.com/tonio/teams/13749/uk/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: uk\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
|
||||
|
||||
#: ldapsync/lib.py:84
|
||||
msgid "Failed to create LDAP account: {}"
|
||||
msgstr "Не вдалося створити обліковий запис LDAP: {}"
|
||||
|
||||
#: ldapsync/lib.py:124
|
||||
msgid "Failed to update LDAP account: {}"
|
||||
msgstr "Не вдалося оновити обліковий запис LDAP: {} "
|
||||
|
||||
#: ldapsync/lib.py:138
|
||||
msgid "Failed to delete LDAP account: {}"
|
||||
msgstr "Не вдалося видалити обліковий запис LDAP: {} "
|
||||
|
||||
#: ldapsync/lib.py:149
|
||||
msgid "Failed to disable LDAP account: {}"
|
||||
msgstr "Не вдалося відключити обліковий запис LDAP: {} "
|
||||
@@ -360,6 +360,14 @@ class TabForms(object):
|
||||
context["tabs"].active_id = active_tab_id
|
||||
return render(self.request, self.template_name, context)
|
||||
|
||||
|
||||
class UserKwargModelFormMixin:
|
||||
"""Simple form mixin to add support for user kwargs in constructor."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.user = kwargs.pop("user")
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
#
|
||||
# Custom fields from here
|
||||
#
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
"""Views utilities."""
|
||||
|
||||
|
||||
class UserFormKwargsMixin:
|
||||
"""A mixin to automatically add a user arg to form instantiation."""
|
||||
|
||||
def get_form_kwargs(self):
|
||||
kwargs = super().get_form_kwargs()
|
||||
kwargs.update({"user": self.request.user})
|
||||
return kwargs
|
||||
@@ -1,18 +1,21 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
# Translators:
|
||||
# Antonino Ioppolo <ioppolo.antonino@gmail.com>, 2017
|
||||
# Rocco <mors10@hotmail.com>, 2015
|
||||
# Antoine Nguyen <tonio@ngyn.org>, 2020
|
||||
# Alessandro Fanna <alex@rospus.org>, 2021
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Modoboa\n"
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-03-09 16:48+0100\n"
|
||||
"PO-Revision-Date: 2020-03-09 15:49+0000\n"
|
||||
"Last-Translator: Antoine Nguyen <tonio@ngyn.org>\n"
|
||||
"Language-Team: Italian (http://www.transifex.com/tonio/modoboa/language/it/)\n"
|
||||
"POT-Creation-Date: 2020-11-05 15:47+0100\n"
|
||||
"PO-Revision-Date: 2020-05-11 18:45+0000\n"
|
||||
"Last-Translator: Alessandro Fanna <alex@rospus.org>, 2021\n"
|
||||
"Language-Team: Italian (https://www.transifex.com/tonio/teams/13749/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -25,7 +28,7 @@ msgstr "'"
|
||||
|
||||
#: bower_components/swagger-ui/dist/swagger-ui-bundle.js:133
|
||||
msgid "operation"
|
||||
msgstr ""
|
||||
msgstr "operazione"
|
||||
|
||||
#: core/static/core/js/settings.js:16
|
||||
msgid "No more log entry to show"
|
||||
@@ -39,7 +42,7 @@ msgstr "Attenzione"
|
||||
msgid "Cancel"
|
||||
msgstr "Elimina"
|
||||
|
||||
#: static/js/global.js:342
|
||||
#: static/js/global.js:347
|
||||
msgid "Internal error"
|
||||
msgstr "Errore interno"
|
||||
|
||||
@@ -54,3 +57,11 @@ msgstr "Ricerca"
|
||||
#: static/js/searchbar.js:28
|
||||
msgid "Search..."
|
||||
msgstr "Ricerca ..."
|
||||
|
||||
#: static/js/twocols_nav.js:170
|
||||
msgid "Are you sure?"
|
||||
msgstr "Sei sicuro?"
|
||||
|
||||
#: static/js/twocols_nav.js:171
|
||||
msgid "This will invalidate your registered application."
|
||||
msgstr "Questo invaliderà la tua domanda di registrazione."
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,19 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Translators:
|
||||
# Andrei-Ilie Olteanu <andrei@flashsoft.ro>, 2018
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Modoboa\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-03-09 16:48+0100\n"
|
||||
"PO-Revision-Date: 2020-03-09 15:49+0000\n"
|
||||
"Last-Translator: Antoine Nguyen <tonio@ngyn.org>\n"
|
||||
"Language-Team: Romanian (Romania) (http://www.transifex.com/tonio/modoboa/language/ro_RO/)\n"
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"PO-Revision-Date: 2020-10-02 13:39+0000\n"
|
||||
"Last-Translator: Simona Iacob <s@zp1.net>, 2021\n"
|
||||
"Language-Team: Romanian (Romania) (https://www.transifex.com/tonio/teams/13749/ro_RO/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -24,11 +26,11 @@ msgstr "'"
|
||||
|
||||
#: bower_components/swagger-ui/dist/swagger-ui-bundle.js:133
|
||||
msgid "operation"
|
||||
msgstr ""
|
||||
msgstr "operațiune"
|
||||
|
||||
#: core/static/core/js/settings.js:16
|
||||
msgid "No more log entry to show"
|
||||
msgstr "Nu mai exită alte rezultate de înregistrări pentru afișare"
|
||||
msgstr "Nu se mai afișează nicio intrare în jurnal"
|
||||
|
||||
#: static/js/confirmation.js:44
|
||||
msgid "Warning"
|
||||
@@ -38,18 +40,26 @@ msgstr "Avertizare"
|
||||
msgid "Cancel"
|
||||
msgstr "Anulare"
|
||||
|
||||
#: static/js/global.js:342
|
||||
#: static/js/global.js:347
|
||||
msgid "Internal error"
|
||||
msgstr "Eroare internă"
|
||||
|
||||
#: static/js/listing.js:21
|
||||
msgid "No more entry to show"
|
||||
msgstr "Nu mai există alte elemente ce pot fi afișate"
|
||||
msgstr "Nu mai sunt mesaje de afișat"
|
||||
|
||||
#: static/js/listing.js:46
|
||||
msgid "Search"
|
||||
msgstr "Caută"
|
||||
msgstr "Căutare"
|
||||
|
||||
#: static/js/searchbar.js:28
|
||||
msgid "Search..."
|
||||
msgstr "Caută..."
|
||||
msgstr "Căutare..."
|
||||
|
||||
#: static/js/twocols_nav.js:170
|
||||
msgid "Are you sure?"
|
||||
msgstr "Sunteți sigur?"
|
||||
|
||||
#: static/js/twocols_nav.js:171
|
||||
msgid "This will invalidate your registered application."
|
||||
msgstr "This will invalidate your registered application."
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
# Translators:
|
||||
# Taras Havryliuk <admin@web4u.in.ua>, 2021
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-11-05 15:47+0100\n"
|
||||
"PO-Revision-Date: 2020-05-11 18:45+0000\n"
|
||||
"Last-Translator: Taras Havryliuk <admin@web4u.in.ua>, 2021\n"
|
||||
"Language-Team: Ukrainian (https://www.transifex.com/tonio/teams/13749/uk/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: uk\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
|
||||
|
||||
#: bower_components/jquery-ui/jquery-ui.min.js:8
|
||||
msgid "'"
|
||||
msgstr "'"
|
||||
|
||||
#: bower_components/swagger-ui/dist/swagger-ui-bundle.js:133
|
||||
msgid "operation"
|
||||
msgstr "операції"
|
||||
|
||||
#: core/static/core/js/settings.js:16
|
||||
msgid "No more log entry to show"
|
||||
msgstr "Більше немає запису в журналі для показу"
|
||||
|
||||
#: static/js/confirmation.js:44
|
||||
msgid "Warning"
|
||||
msgstr "Увага"
|
||||
|
||||
#: static/js/confirmation.js:59
|
||||
msgid "Cancel"
|
||||
msgstr "Відміна"
|
||||
|
||||
#: static/js/global.js:347
|
||||
msgid "Internal error"
|
||||
msgstr "Внутрішня помилка"
|
||||
|
||||
#: static/js/listing.js:21
|
||||
msgid "No more entry to show"
|
||||
msgstr "Немає більше записів для показу"
|
||||
|
||||
#: static/js/listing.js:46
|
||||
msgid "Search"
|
||||
msgstr "Пошук"
|
||||
|
||||
#: static/js/searchbar.js:28
|
||||
msgid "Search..."
|
||||
msgstr "Пошук..."
|
||||
|
||||
#: static/js/twocols_nav.js:170
|
||||
msgid "Are you sure?"
|
||||
msgstr "Ви впевнені?"
|
||||
|
||||
#: static/js/twocols_nav.js:171
|
||||
msgid "This will invalidate your registered application."
|
||||
msgstr "Це призведе до втрати вашої зареєстрованої програми."
|
||||
+2
-3
@@ -1,11 +1,10 @@
|
||||
django>=2.2,<2.3
|
||||
django-braces==1.14.0
|
||||
django-ckeditor==6.0.0
|
||||
django-phonenumber-field[phonenumbers]==5.0.0
|
||||
django-phonenumber-field[phonenumbers]==5.1.0
|
||||
django-reversion==3.0.9
|
||||
django-xforwardedfor-middleware==2.0
|
||||
django-webpack-loader
|
||||
django-otp==1.0.2
|
||||
django-otp==1.0.5
|
||||
django-filter
|
||||
|
||||
dj-database-url
|
||||
|
||||
Reference in New Issue
Block a user