Autoadmin: Incorporate the autoadmin app

Incorporate the external django-autoadmin app as a core app
and convert it into a Mayan app. This change adds the new
settings: "COMMON_AUTOADMIN_EMAIL", "AUTOADMIN_PASSWORD", and
"AUTOADMIN_USERNAME".

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-07 03:09:59 -04:00
parent 28a1ecb685
commit 8039dfa30a
53 changed files with 2584 additions and 30 deletions

View File

@@ -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/<lang>/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/<lang>/LC_MESSAGES/django.po
source_lang = en

View File

@@ -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)
==================

View File

@@ -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 = (

View File

@@ -13,28 +13,7 @@
{% block project_name %}{% endblock %}
{% block content_plain %}
{% autoadmin_properties %}
{% if autoadmin_properties.account %}
<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">{% trans "First time login" %}</h3>
</div>
<div class="panel-body">
{% smart_setting 'COMMON_PROJECT_TITLE' as project_title %}
<p>{% blocktrans %}You have just finished installing <strong>{{ project_title }}</strong>, congratulations!{% endblocktrans %}</p>
<p>{% trans 'Login using the following credentials:' %}</p>
<p>{% blocktrans with autoadmin_properties.account as account %}Username: <strong>{{ account }}</strong>{% endblocktrans %}</p>
<p>{% blocktrans with autoadmin_properties.account.email as email %}Email: <strong>{{ email }}</strong>{% endblocktrans %}</p>
<p>{% blocktrans with autoadmin_properties.password as password %}Password: <strong>{{ password }}</strong>{% endblocktrans %}</p>
<p>{% trans 'Be sure to change the password to increase security and to disable this message.' %}</p>
</div>
</div>
</div>
</div>
{% endif %}
{% autoadmin_partial %}
{% motd %}
<div class="row">

View File

@@ -0,0 +1,3 @@
from __future__ import unicode_literals
default_app_config = 'mayan.apps.autoadmin.apps.AutoAdminAppConfig'

View File

@@ -0,0 +1,7 @@
from __future__ import unicode_literals
from django.contrib import admin
from .models import AutoAdminSingleton
admin.site.register(AutoAdminSingleton)

View File

@@ -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
)

View File

View File

@@ -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.')
)

View File

@@ -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()

View File

@@ -0,0 +1,5 @@
from __future__ import unicode_literals
DEFAULT_EMAIL = 'autoadmin@example.com'
DEFAULT_PASSWORD = None
DEFAULT_USERNAME = 'admin'

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 <strong>%(project_title)s</strong>, "
"congratulations!"
msgstr ""
#: templates/autoadmin/credentials.html:17
msgid "Login using the following credentials:"
msgstr ""
#: templates/autoadmin/credentials.html:18
#, python-format
msgid "Username: <strong>%(account)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:19
#, python-format
msgid "Email: <strong>%(email)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:20
#, python-format
msgid "Password: <strong>%(password)s</strong>"
msgstr ""
#: templates/autoadmin/credentials.html:21
msgid ""
"Be sure to change the password to increase security and to disable this "
"message."
msgstr ""

View File

@@ -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()

View File

@@ -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
)

View File

@@ -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,),
),
]

View File

@@ -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')

View File

@@ -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.'
)
)

View File

@@ -0,0 +1,27 @@
{% load i18n %}
{% load smart_settings_tags %}
{% if autoadmin_properties.account %}
<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4">
<br>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">{% trans 'First time login' %}</h3>
</div>
<div class="panel-body">
<div class="content login">
{% smart_setting 'COMMON_PROJECT_TITLE' as project_title %}
<p>{% blocktrans %}You have just finished installing <strong>{{ project_title }}</strong>, congratulations!{% endblocktrans %}</p>
<p>{% trans 'Login using the following credentials:' %}</p>
<p>{% blocktrans with autoadmin_properties.account as account %}Username: <strong>{{ account }}</strong>{% endblocktrans %}</p>
<p>{% blocktrans with autoadmin_properties.account.email as email %}Email: <strong>{{ email }}</strong>{% endblocktrans %}</p>
<p>{% blocktrans with autoadmin_properties.password as password %}Password: <strong>{{ password }}</strong>{% endblocktrans %}</p>
<p>{% trans 'Be sure to change the password to increase security and to disable this message.' %}</p>
</div>
</div>
</div>
</div>
</div>
{% endif %}

View File

@@ -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}

View File

View File

@@ -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'

View File

@@ -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)

View File

@@ -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)

View File

@@ -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
)

View File

@@ -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

View File

@@ -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',

View File

@@ -1,5 +1,6 @@
# Packages to be remove during upgrades
cssmin
django-autoadmin
django-celery
django-compressor
django-environ

View File

@@ -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