diff --git a/.tx/config b/.tx/config index f2d91534ce..b4cdcd1b61 100644 --- a/.tx/config +++ b/.tx/config @@ -13,6 +13,12 @@ source_lang = en source_file = mayan/apps/appearance/locale/en/LC_MESSAGES/django.po type = PO +[mayan-edms.autoadmin-2-0] +file_filter = mayan/apps/autoadmin/locale//LC_MESSAGES/django.po +source_lang = en +source_file = mayan/apps/autoadmin/locale/en/LC_MESSAGES/django.po +type = PO + [mayan-edms.authentication-2-0] file_filter = mayan/apps/authentication/locale//LC_MESSAGES/django.po source_lang = en diff --git a/HISTORY.rst b/HISTORY.rst index 3b0720e01f..93eac64380 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -159,6 +159,10 @@ from the common app. The HOME_VIEW has been moved to the COMMON namespace and renamed to COMMON_HOME_VIEW. - New link added to display the events of the current user. +- Incorporate the django-autoadmin app and convert it + into a Mayan app. With change adds the new settings: + "COMMON_AUTOADMIN_EMAIL", "AUTOADMIN_PASSWORD", and + "AUTOADMIN_USERNAME". 3.1.9 (2018-11-01) ================== diff --git a/contrib/scripts/process_messages.py b/contrib/scripts/process_messages.py index 11783c8ce5..afdbdd33a1 100755 --- a/contrib/scripts/process_messages.py +++ b/contrib/scripts/process_messages.py @@ -9,13 +9,13 @@ import sh APP_LIST = ( - 'acls', 'appearance', 'authentication', 'cabinets', 'checkouts', 'common', - 'converter', 'django_gpg', 'document_comments', 'document_indexing', - 'document_parsing', 'document_signatures', 'document_states', 'documents', - 'dynamic_search', 'events', 'linking', 'lock_manager', 'mayan_statistics', - 'mailer', 'metadata', 'mirroring', 'motd', 'navigation', 'ocr', 'permissions', - 'rest_api', 'smart_settings', 'sources', 'storage', 'tags', 'task_manager', - 'user_management' + 'acls', 'appearance', 'authentication', 'autoadmin', 'cabinets', + 'checkouts', 'common', 'converter', 'django_gpg', 'document_comments', + 'document_indexing', 'document_parsing', 'document_signatures', + 'document_states', 'documents', 'dynamic_search', 'events', 'linking', + 'lock_manager', 'mayan_statistics', 'mailer', 'metadata', 'mirroring', + 'motd', 'navigation', 'ocr', 'permissions', 'rest_api', 'smart_settings', + 'sources', 'storage', 'tags', 'task_manager', 'user_management' ) LANGUAGE_LIST = ( diff --git a/mayan/apps/appearance/templates/authentication/login.html b/mayan/apps/appearance/templates/authentication/login.html index bb1b038718..dcbe3ed42d 100644 --- a/mayan/apps/appearance/templates/authentication/login.html +++ b/mayan/apps/appearance/templates/authentication/login.html @@ -13,28 +13,7 @@ {% block project_name %}{% endblock %} {% block content_plain %} - {% autoadmin_properties %} - {% if autoadmin_properties.account %} -
-
-
-
-

{% trans "First time login" %}

-
-
- {% smart_setting 'COMMON_PROJECT_TITLE' as project_title %} -

{% blocktrans %}You have just finished installing {{ project_title }}, congratulations!{% endblocktrans %}

-

{% trans 'Login using the following credentials:' %}

-

{% blocktrans with autoadmin_properties.account as account %}Username: {{ account }}{% endblocktrans %}

-

{% blocktrans with autoadmin_properties.account.email as email %}Email: {{ email }}{% endblocktrans %}

-

{% blocktrans with autoadmin_properties.password as password %}Password: {{ password }}{% endblocktrans %}

-

{% trans 'Be sure to change the password to increase security and to disable this message.' %}

-
-
-
-
- {% endif %} - + {% autoadmin_partial %} {% motd %}
diff --git a/mayan/apps/autoadmin/__init__.py b/mayan/apps/autoadmin/__init__.py new file mode 100644 index 0000000000..59b306fb76 --- /dev/null +++ b/mayan/apps/autoadmin/__init__.py @@ -0,0 +1,3 @@ +from __future__ import unicode_literals + +default_app_config = 'mayan.apps.autoadmin.apps.AutoAdminAppConfig' diff --git a/mayan/apps/autoadmin/admin.py b/mayan/apps/autoadmin/admin.py new file mode 100644 index 0000000000..d538a257e2 --- /dev/null +++ b/mayan/apps/autoadmin/admin.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals + +from django.contrib import admin + +from .models import AutoAdminSingleton + +admin.site.register(AutoAdminSingleton) diff --git a/mayan/apps/autoadmin/apps.py b/mayan/apps/autoadmin/apps.py new file mode 100644 index 0000000000..0c69c294aa --- /dev/null +++ b/mayan/apps/autoadmin/apps.py @@ -0,0 +1,23 @@ +from __future__ import unicode_literals + +from django.conf import settings +from django.db.models.signals import post_save +from django.utils.translation import ugettext_lazy as _ + +from mayan.apps.common import MayanAppConfig + +from .handlers import handler_auto_admin_account_password_change + + +class AutoAdminAppConfig(MayanAppConfig): + has_tests = True + name = 'mayan.apps.autoadmin' + verbose_name = _('Auto administrator') + + def ready(self): + super(AutoAdminAppConfig, self).ready() + post_save.connect( + dispatch_uid='auto_admin_account_password_change', + receiver=handler_auto_admin_account_password_change, + sender=settings.AUTH_USER_MODEL + ) diff --git a/mayan/apps/autoadmin/auth/__init__.py b/mayan/apps/autoadmin/auth/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/autoadmin/auth/allauth.py b/mayan/apps/autoadmin/auth/allauth.py new file mode 100644 index 0000000000..8744093728 --- /dev/null +++ b/mayan/apps/autoadmin/auth/allauth.py @@ -0,0 +1,55 @@ +""" +Authentication adapters for Allauth +""" +try: + from allauth.account.adapter import DefaultAccountAdapter +except ImportError: + print('ERROR: This authentication adapter requires django-allauth.') + raise + +from django.conf import settings +from django.contrib import messages +from django.utils.translation import ugettext_lazy as _ + +ADMIN_EMAIL_ADDRESSES = [email for name, email in settings.ADMINS] + + +class AutoadminAccountAdapter(DefaultAccountAdapter): + """ + Allauth account adapter that enables automatic grant of admin permissions + to users signing up having their email address listed in the ``ADMINS`` + Django settings. Django settings needed to activate this feature: + + INSTALLED_APPS = [ + 'django.contrib.auth', + 'django.contrib.sites', + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + ] + + ACCOUNT_ADAPTER = 'autoadmin.auth.allauth.AutoadminAccountAdapter' + + See also: + - http://django-allauth.readthedocs.io/en/latest/configuration.html + - http://django-allauth.readthedocs.io/en/latest/advanced.html#admin + """ + + def confirm_email(self, request, email_address): + """ + Give superuser privileges automagically if the email address of a + user confirming their email is listed in ``settings.ADMINS``. + """ + super(AutoadminAccountAdapter, + self).confirm_email(request, email_address) + + if email_address.email in ADMIN_EMAIL_ADDRESSES: + user = email_address.user + user.is_staff = user.is_superuser = True + user.save() + + messages.add_message( + request, messages.INFO, + _('Welcome Admin! You have been given superuser privileges. ' + 'Use them with caution.') + ) diff --git a/mayan/apps/autoadmin/handlers.py b/mayan/apps/autoadmin/handlers.py new file mode 100644 index 0000000000..7dd1d0df60 --- /dev/null +++ b/mayan/apps/autoadmin/handlers.py @@ -0,0 +1,20 @@ +from __future__ import unicode_literals + +from django.apps import apps + + +def handler_auto_admin_account_password_change(sender, instance, **kwargs): + AutoAdminSingleton = apps.get_model( + app_label='autoadmin', model_name='AutoAdminSingleton' + ) + + auto_admin_properties, created = AutoAdminSingleton.objects.get_or_create() + + if instance == auto_admin_properties.account and \ + instance.password != auto_admin_properties.password_hash: + # Only delete the auto admin properties when the password + # has been changed + auto_admin_properties.account = None + auto_admin_properties.password = None + auto_admin_properties.password_hash = None + auto_admin_properties.save() diff --git a/mayan/apps/autoadmin/literals.py b/mayan/apps/autoadmin/literals.py new file mode 100644 index 0000000000..f592fcc835 --- /dev/null +++ b/mayan/apps/autoadmin/literals.py @@ -0,0 +1,5 @@ +from __future__ import unicode_literals + +DEFAULT_EMAIL = 'autoadmin@example.com' +DEFAULT_PASSWORD = None +DEFAULT_USERNAME = 'admin' diff --git a/mayan/apps/autoadmin/locale/ar/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/ar/LC_MESSAGES/django.po new file mode 100644 index 0000000000..35769d384e --- /dev/null +++ b/mayan/apps/autoadmin/locale/ar/LC_MESSAGES/django.po @@ -0,0 +1,96 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/bg/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/bg/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2d29e5f9c0 --- /dev/null +++ b/mayan/apps/autoadmin/locale/bg/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/bs_BA/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/bs_BA/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/bs_BA/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/da/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/da/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2d29e5f9c0 --- /dev/null +++ b/mayan/apps/autoadmin/locale/da/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/de_DE/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/de_DE/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/de_DE/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/en/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/es/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/es/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2d29e5f9c0 --- /dev/null +++ b/mayan/apps/autoadmin/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/fa/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/fa/LC_MESSAGES/django.po new file mode 100644 index 0000000000..b5abbb7c76 --- /dev/null +++ b/mayan/apps/autoadmin/locale/fa/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/fr/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000000..5567df32d5 --- /dev/null +++ b/mayan/apps/autoadmin/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/hu/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/hu/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2d29e5f9c0 --- /dev/null +++ b/mayan/apps/autoadmin/locale/hu/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/id/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/id/LC_MESSAGES/django.po new file mode 100644 index 0000000000..b5abbb7c76 --- /dev/null +++ b/mayan/apps/autoadmin/locale/id/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/it/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/it/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2d29e5f9c0 --- /dev/null +++ b/mayan/apps/autoadmin/locale/it/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/nl_NL/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/nl_NL/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/nl_NL/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/pl/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000000..139e9e5b28 --- /dev/null +++ b/mayan/apps/autoadmin/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,97 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" +"%100<12 || n%100>=14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" +"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/pt/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/pt/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2d29e5f9c0 --- /dev/null +++ b/mayan/apps/autoadmin/locale/pt/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/pt_BR/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/pt_BR/LC_MESSAGES/django.po new file mode 100644 index 0000000000..5567df32d5 --- /dev/null +++ b/mayan/apps/autoadmin/locale/pt_BR/LC_MESSAGES/django.po @@ -0,0 +1,95 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/ro_RO/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/ro_RO/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/ro_RO/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/ru/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 0000000000..5f9ed3b846 --- /dev/null +++ b/mayan/apps/autoadmin/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,97 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/sl_SI/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/sl_SI/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/sl_SI/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/tr_TR/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/tr_TR/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/tr_TR/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/vi_VN/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/vi_VN/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/vi_VN/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/locale/zh_CN/LC_MESSAGES/django.po b/mayan/apps/autoadmin/locale/zh_CN/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e7aab15073 --- /dev/null +++ b/mayan/apps/autoadmin/locale/zh_CN/LC_MESSAGES/django.po @@ -0,0 +1,94 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-07 02:23-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:16 settings.py:9 +msgid "Auto administrator" +msgstr "" + +#: auth/allauth.py:53 +msgid "" +"Welcome Admin! You have been given superuser privileges. Use them with " +"caution." +msgstr "" + +#: models.py:64 +msgid "Account" +msgstr "" + +#: models.py:67 +msgid "Password" +msgstr "" + +#: models.py:70 +msgid "Password hash" +msgstr "" + +#: models.py:76 +msgid "Autoadmin properties" +msgstr "" + +#: settings.py:14 +msgid "Sets the email of the automatically created super user account." +msgstr "" + +#: settings.py:20 +msgid "" +"The password of the automatically created super user account. If it is equal " +"to None, the password is randomly generated." +msgstr "" + +#: settings.py:27 +msgid "The username of the automatically created super user account." +msgstr "" + +#: templates/autoadmin/credentials.html:11 +msgid "First time login" +msgstr "" + +#: templates/autoadmin/credentials.html:16 +#, python-format +msgid "" +"You have just finished installing %(project_title)s, " +"congratulations!" +msgstr "" + +#: templates/autoadmin/credentials.html:17 +msgid "Login using the following credentials:" +msgstr "" + +#: templates/autoadmin/credentials.html:18 +#, python-format +msgid "Username: %(account)s" +msgstr "" + +#: templates/autoadmin/credentials.html:19 +#, python-format +msgid "Email: %(email)s" +msgstr "" + +#: templates/autoadmin/credentials.html:20 +#, python-format +msgid "Password: %(password)s" +msgstr "" + +#: templates/autoadmin/credentials.html:21 +msgid "" +"Be sure to change the password to increase security and to disable this " +"message." +msgstr "" diff --git a/mayan/apps/autoadmin/management/__init__.py b/mayan/apps/autoadmin/management/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/autoadmin/management/commands/__init__.py b/mayan/apps/autoadmin/management/commands/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/autoadmin/management/commands/createautoadmin.py b/mayan/apps/autoadmin/management/commands/createautoadmin.py new file mode 100644 index 0000000000..c617c4f232 --- /dev/null +++ b/mayan/apps/autoadmin/management/commands/createautoadmin.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals + +from django.core.management.base import BaseCommand + +from ...models import AutoAdminSingleton + + +class Command(BaseCommand): + help = 'Used to create a superuser with a secure and automatic password.' + + def handle(self, *args, **options): + AutoAdminSingleton.objects.create_autoadmin() diff --git a/mayan/apps/autoadmin/managers.py b/mayan/apps/autoadmin/managers.py new file mode 100644 index 0000000000..1ee0b905a2 --- /dev/null +++ b/mayan/apps/autoadmin/managers.py @@ -0,0 +1,57 @@ +from __future__ import unicode_literals + +import logging + +from django.contrib.auth import get_user_model +from django.core import management +from django.db import models + +from .settings import setting_email, setting_password, setting_username + +logger = logging.getLogger(__name__) + + +class AutoAdminSingletonManager(models.Manager): + def create_autoadmin(self): + UserModel = get_user_model() + + if setting_password.value is None: + password = UserModel.objects.make_random_password() + else: + password = setting_password.value + + try: + UserModel.objects.get( + **{UserModel.USERNAME_FIELD: setting_username.value} + ) + except UserModel.DoesNotExist: + logger.info( + 'Creating superuser -- login: %s, email: %s, password: %s', + setting_username.value, setting_email.value, password + ) + management.call_command( + 'createsuperuser', + **{ + UserModel.USERNAME_FIELD: setting_username.value, + 'email': setting_email.value, + 'interactive': False + } + ) + + account = UserModel.objects.get( + **{UserModel.USERNAME_FIELD: setting_username.value} + ) + account.set_password(raw_password=password) + account.save() + # Store the auto admin password properties to display the + # first login message + auto_admin_properties, created = self.get_or_create() # NOQA + auto_admin_properties.account = account + auto_admin_properties.password = password + auto_admin_properties.password_hash = account.password + auto_admin_properties.save() + else: + logger.error( + 'Super admin user already exists. -- login: %s', + setting_username.value + ) diff --git a/mayan/apps/autoadmin/migrations/0001_initial.py b/mayan/apps/autoadmin/migrations/0001_initial.py new file mode 100644 index 0000000000..d41e526214 --- /dev/null +++ b/mayan/apps/autoadmin/migrations/0001_initial.py @@ -0,0 +1,49 @@ +from __future__ import unicode_literals + +from django.conf import settings +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='AutoAdminSingleton', + fields=[ + ( + 'id', models.AutoField( + verbose_name='ID', serialize=False, auto_created=True, + primary_key=True + ) + ), + ( + 'password', models.CharField( + max_length=128, null=True, verbose_name='Password', + blank=True + ) + ), + ( + 'password_hash', models.CharField( + max_length=128, null=True, + verbose_name='Password hash', blank=True + ) + ), + ( + 'account', models.ForeignKey( + verbose_name='Account', blank=True, + to=settings.AUTH_USER_MODEL, null=True, + on_delete=models.CASCADE + ) + ), + ], + options={ + 'verbose_name': 'Autoadmin properties', + 'verbose_name_plural': 'Autoadmin properties', + }, + bases=(models.Model,), + ), + ] diff --git a/mayan/apps/autoadmin/migrations/__init__.py b/mayan/apps/autoadmin/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/autoadmin/models.py b/mayan/apps/autoadmin/models.py new file mode 100644 index 0000000000..75e496b87f --- /dev/null +++ b/mayan/apps/autoadmin/models.py @@ -0,0 +1,27 @@ +from __future__ import unicode_literals + +from django.conf import settings +from django.db import models +from django.utils.translation import ugettext_lazy as _ + +from solo.models import SingletonModel + +from .managers import AutoAdminSingletonManager + + +class AutoAdminSingleton(SingletonModel): + account = models.ForeignKey( + blank=True, null=True, on_delete=models.CASCADE, + to=settings.AUTH_USER_MODEL, verbose_name=_('Account'), + ) + password = models.CharField( + blank=True, max_length=128, null=True, verbose_name=_('Password') + ) + password_hash = models.CharField( + blank=True, max_length=128, null=True, verbose_name=_('Password hash') + ) + + objects = AutoAdminSingletonManager() + + class Meta: + verbose_name = verbose_name_plural = _('Autoadmin properties') diff --git a/mayan/apps/autoadmin/settings.py b/mayan/apps/autoadmin/settings.py new file mode 100644 index 0000000000..709869099c --- /dev/null +++ b/mayan/apps/autoadmin/settings.py @@ -0,0 +1,29 @@ +from __future__ import unicode_literals + +from django.utils.translation import ugettext_lazy as _ + +from mayan.apps.smart_settings import Namespace + +from .literals import DEFAULT_EMAIL, DEFAULT_PASSWORD, DEFAULT_USERNAME + +namespace = Namespace(name='autoadmin', label=_('Auto administrator')) + +setting_email = namespace.add_setting( + global_name='AUTOADMIN_EMAIL', default=DEFAULT_EMAIL, + help_text=_( + 'Sets the email of the automatically created super user account.' + ) +) +setting_password = namespace.add_setting( + global_name='AUTOADMIN_PASSWORD', default=DEFAULT_PASSWORD, + help_text=_( + 'The password of the automatically created super user account. ' + 'If it is equal to None, the password is randomly generated.' + ) +) +setting_username = namespace.add_setting( + global_name='AUTOADMIN_USERNAME', default=DEFAULT_USERNAME, + help_text=_( + 'The username of the automatically created super user account.' + ) +) diff --git a/mayan/apps/autoadmin/templates/autoadmin/credentials.html b/mayan/apps/autoadmin/templates/autoadmin/credentials.html new file mode 100755 index 0000000000..7e89a5be15 --- /dev/null +++ b/mayan/apps/autoadmin/templates/autoadmin/credentials.html @@ -0,0 +1,27 @@ +{% load i18n %} + +{% load smart_settings_tags %} + +{% if autoadmin_properties.account %} +
+
+
+
+
+

{% trans 'First time login' %}

+
+
+ +
+
+
+
+{% endif %} diff --git a/mayan/apps/autoadmin/templatetags/__init__.py b/mayan/apps/autoadmin/templatetags/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/autoadmin/templatetags/autoadmin_tags.py b/mayan/apps/autoadmin/templatetags/autoadmin_tags.py new file mode 100644 index 0000000000..ff670ffeaf --- /dev/null +++ b/mayan/apps/autoadmin/templatetags/autoadmin_tags.py @@ -0,0 +1,25 @@ +from __future__ import unicode_literals + +from django.template import Library + +from ..models import AutoAdminSingleton + +register = Library() + + +@register.simple_tag(takes_context=True) +def autoadmin_properties(context): + try: + context['autoadmin_properties'] = AutoAdminSingleton.objects.get() + except AutoAdminSingleton.DoesNotExist: + context['autoadmin_properties'] = None + + return '' + + +@register.inclusion_tag('autoadmin/credentials.html') +def autoadmin_partial(): + try: + return {'autoadmin_properties': AutoAdminSingleton.objects.get()} + except AutoAdminSingleton.DoesNotExist: + return {'autoadmin_properties': None} diff --git a/mayan/apps/autoadmin/tests/__init__.py b/mayan/apps/autoadmin/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/autoadmin/tests/literals.py b/mayan/apps/autoadmin/tests/literals.py new file mode 100644 index 0000000000..c217b05800 --- /dev/null +++ b/mayan/apps/autoadmin/tests/literals.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals + +TEST_ADMIN_USER_EMAIL = 'testemail@example.com' +TEST_ADMIN_USER_PASSWORD = 'test admin user password' +TEST_ADMIN_USER_USERNAME = 'test_admin_user_username' +TEST_FIRST_TIME_LOGIN_TEXT = 'First time login' +TEST_MOCK_VIEW_TEXT = 'mock view text' diff --git a/mayan/apps/autoadmin/tests/test_management_commands.py b/mayan/apps/autoadmin/tests/test_management_commands.py new file mode 100644 index 0000000000..9de71acd1f --- /dev/null +++ b/mayan/apps/autoadmin/tests/test_management_commands.py @@ -0,0 +1,28 @@ +from __future__ import unicode_literals + +from django.contrib.auth import get_user_model +from django.core import management +from django.test import TestCase + +from mayan.apps.common.tests.utils import mute_stdout + +from ..models import AutoAdminSingleton + + +class AutoAdminManagementCommandTestCase(TestCase): + def setUp(self): + with mute_stdout(): + management.call_command('createautoadmin') + + def tearDown(self): + AutoAdminSingleton.objects.all().delete() + + def test_autoadmin_creation(self): + autoadmin = AutoAdminSingleton.objects.get() + user = get_user_model().objects.first() + + self.assertEqual(AutoAdminSingleton.objects.count(), 1) + + self.assertEqual(autoadmin.account, user) + self.assertEqual(autoadmin.account.email, user.email) + self.assertEqual(autoadmin.password_hash, user.password) diff --git a/mayan/apps/autoadmin/tests/test_models.py b/mayan/apps/autoadmin/tests/test_models.py new file mode 100644 index 0000000000..f45f5ede31 --- /dev/null +++ b/mayan/apps/autoadmin/tests/test_models.py @@ -0,0 +1,43 @@ +from __future__ import unicode_literals + +import logging + +from django.test import TestCase + +from mayan.apps.common.tests.utils import mute_stdout + +from ..models import AutoAdminSingleton +from ..settings import setting_username + +from .literals import TEST_ADMIN_USER_PASSWORD + + +class AutoAdminHandlerTestCase(TestCase): + def test_post_admin_creation(self): + logging.disable(logging.INFO) + + with mute_stdout(): + AutoAdminSingleton.objects.create_autoadmin() + + self.assertEqual( + AutoAdminSingleton.objects.get().account.username, + setting_username.value + ) + + user = AutoAdminSingleton.objects.get().account + + user.set_password(TEST_ADMIN_USER_PASSWORD) + user.save(update_fields=['password']) + + self.assertEqual(AutoAdminSingleton.objects.get().account, None) + + def test_double_creation(self): + with mute_stdout(): + AutoAdminSingleton.objects.create_autoadmin() + + self.assertEqual(AutoAdminSingleton.objects.count(), 1) + + logging.disable(logging.ERROR) + + AutoAdminSingleton.objects.create_autoadmin() + self.assertEqual(AutoAdminSingleton.objects.count(), 1) diff --git a/mayan/apps/autoadmin/tests/test_views.py b/mayan/apps/autoadmin/tests/test_views.py new file mode 100644 index 0000000000..c72afa1700 --- /dev/null +++ b/mayan/apps/autoadmin/tests/test_views.py @@ -0,0 +1,45 @@ +from __future__ import unicode_literals + +from django.test import TestCase +from django.urls import reverse + +from mayan.apps.common.settings import setting_home_view +from mayan.apps.common.tests.utils import mute_stdout + +from ..models import AutoAdminSingleton + +from .literals import TEST_FIRST_TIME_LOGIN_TEXT, TEST_MOCK_VIEW_TEXT + + +class AutoAdminViewCase(TestCase): + def setUp(self): + with mute_stdout(): + AutoAdminSingleton.objects.create_autoadmin() + + def _request_home_view(self): + return self.client.get( + reverse(setting_home_view.value), follow=True + ) + + def test_login_302_view(self): + response = self._request_home_view() + + self.assertContains( + response=response, text=TEST_FIRST_TIME_LOGIN_TEXT, + status_code=200 + ) + + def test_login_ok_view(self): + autoadmin = AutoAdminSingleton.objects.get() + logged_in = self.client.login( + username=autoadmin.account, + password=autoadmin.password + ) + self.assertTrue(logged_in) + + response = self._request_home_view() + + self.assertNotContains( + response=response, text=TEST_MOCK_VIEW_TEXT, + status_code=200 + ) diff --git a/mayan/apps/common/tests/utils.py b/mayan/apps/common/tests/utils.py new file mode 100644 index 0000000000..85daf0c524 --- /dev/null +++ b/mayan/apps/common/tests/utils.py @@ -0,0 +1,15 @@ +from contextlib import contextmanager +import sys + + +class NullFile(object): + def write(self, string): + """Writes here go nowhere""" + + +@contextmanager +def mute_stdout(): + stdout_old = sys.stdout + sys.stdout = NullFile() + yield + sys.stdout = stdout_old diff --git a/mayan/settings/base.py b/mayan/settings/base.py index f5bd311660..9bd6a487ae 100644 --- a/mayan/settings/base.py +++ b/mayan/settings/base.py @@ -68,7 +68,6 @@ INSTALLED_APPS = ( 'django.contrib.staticfiles', # 3rd party 'actstream', - 'autoadmin', 'colorful', 'corsheaders', 'djcelery', @@ -84,6 +83,7 @@ INSTALLED_APPS = ( # Base apps 'mayan.apps.acls', 'mayan.apps.authentication', + 'mayan.apps.autoadmin', 'mayan.apps.common', 'mayan.apps.converter', 'mayan.apps.django_gpg', diff --git a/removals.txt b/removals.txt index 35e0a35ecf..4b63c7c355 100644 --- a/removals.txt +++ b/removals.txt @@ -1,5 +1,6 @@ # Packages to be remove during upgrades cssmin +django-autoadmin django-celery django-compressor django-environ diff --git a/requirements/base.txt b/requirements/base.txt index d4f0a5eda3..3f05d8b4f9 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -15,6 +15,7 @@ django-mathfilters==0.4.0 django-model-utils==3.1.2 django-mptt==0.9.1 django-qsstats-magic==1.0.0 +django-solo==1.1.3 django-stronghold==0.3.0 django-widget-tweaks==1.4.3 djangorestframework==3.7.7