Integrate django-autoadmin into the core apps

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-13 23:54:08 -04:00
parent 2a780cb4b0
commit 9e262220e5
54 changed files with 2569 additions and 54 deletions

View File

@@ -19,6 +19,12 @@ source_lang = en
source_file = mayan/apps/authentication/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/authentication/locale/en/LC_MESSAGES/django.po
type = 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.cabinets-2-0] [mayan-edms.cabinets-2-0]
file_filter = mayan/apps/cabinets/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/cabinets/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en

View File

@@ -48,6 +48,7 @@
* Move stub filtering to the Document model manager. * Move stub filtering to the Document model manager.
* Increase the default number of recently added documents and * Increase the default number of recently added documents and
recently accessed documents from 40 to 400. recently accessed documents from 40 to 400.
* Integrate django-autoadmin into the core apps.
3.1.11 (2019-04-XX) 3.1.11 (2019-04-XX)
=================== ===================

View File

@@ -9,12 +9,13 @@ import sh
APP_LIST = ( APP_LIST = (
'acls', 'appearance', 'authentication', 'cabinets', 'checkouts', 'acls', 'appearance', 'authentication', 'autoadmin', 'cabinets',
'common', 'converter', 'dashboards', 'django_gpg', 'document_comments', 'checkouts', 'common', 'converter', 'dashboards', 'django_gpg',
'document_indexing', 'document_parsing', 'document_signatures', 'document_comments', 'document_indexing', 'document_parsing',
'document_states', 'documents', 'dynamic_search', 'events', 'linking', 'document_signatures', 'document_states', 'documents',
'lock_manager', 'mayan_statistics', 'mailer', 'metadata', 'mirroring', 'dynamic_search', 'events', 'linking', 'lock_manager',
'motd', 'navigation', 'ocr', 'permissions', 'rest_api', 'smart_settings', 'mayan_statistics', 'mailer', 'metadata', 'mirroring', 'motd',
'navigation', 'ocr', 'permissions', 'rest_api', 'smart_settings',
'sources', 'storage', 'tags', 'task_manager', 'user_management' 'sources', 'storage', 'tags', 'task_manager', 'user_management'
) )

View File

@@ -72,6 +72,7 @@ Other changes
* Move stub filtering to the Document model manager. * Move stub filtering to the Document model manager.
* Increase the default number of recently added documents and * Increase the default number of recently added documents and
recently accessed documents from 40 to 400. recently accessed documents from 40 to 400.
* Integrate django-autoadmin into the core apps.
Removals Removals
-------- --------

View File

@@ -13,28 +13,7 @@
{% block project_name %}{% endblock %} {% block project_name %}{% endblock %}
{% block content_plain %} {% block content_plain %}
{% autoadmin_properties %} {% autoadmin_partial %}
{% 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 %}
{% motd %} {% motd %}
<div class="row"> <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_handler_account_password_change',
receiver=handler_auto_admin_account_password_change,
sender=settings.AUTH_USER_MODEL
)

View File

View File

@@ -0,0 +1,57 @@
"""
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=request, email_address=email_address
)
if email_address.email in ADMIN_EMAIL_ADDRESSES:
user = email_address.user
user.is_staff = user.is_superuser = True
user.save()
messages.info(
request=request, message=_(
'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 migrations, models
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(label=_('Auto administrator'), name='autoadmin')
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,46 @@
from __future__ import unicode_literals
from mayan.apps.common.settings import setting_home_view
from mayan.apps.common.tests import GenericViewTestCase
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(GenericViewTestCase):
auto_create_group = False
auto_create_users = False
auto_login_user = False
def setUp(self):
super(AutoAdminViewCase, self).setUp()
with mute_stdout():
AutoAdminSingleton.objects.create_autoadmin()
def _request_home_view(self):
return self.get(viewname=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.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

@@ -113,30 +113,6 @@ let you distribute a modified version without making your
changes open source. changes open source.
''') ''')
Package(label='django-autoadmin', license_text='''
The MIT License (MIT)
Copyright (c) 2014 Roberto Rosario
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
''')
Package(label='django-celery', license_text=''' Package(label='django-celery', license_text='''
Copyright (c) 2012-2013 GoPivotal, Inc. All Rights Reserved. Copyright (c) 2012-2013 GoPivotal, Inc. All Rights Reserved.
Copyright (c) 2009-2012 Ask Solem. All Rights Reserved. Copyright (c) 2009-2012 Ask Solem. All Rights Reserved.

View File

@@ -74,7 +74,6 @@ INSTALLED_APPS = (
'django.contrib.staticfiles', 'django.contrib.staticfiles',
# 3rd party # 3rd party
'actstream', 'actstream',
'autoadmin',
'colorful', 'colorful',
'corsheaders', 'corsheaders',
'djcelery', 'djcelery',
@@ -90,6 +89,7 @@ INSTALLED_APPS = (
# Base apps # Base apps
'mayan.apps.acls', 'mayan.apps.acls',
'mayan.apps.authentication', 'mayan.apps.authentication',
'mayan.apps.autoadmin',
'mayan.apps.common', 'mayan.apps.common',
'mayan.apps.converter', 'mayan.apps.converter',
'mayan.apps.dashboards', 'mayan.apps.dashboards',

View File

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

View File

@@ -4,7 +4,6 @@ PyYAML==5.1
celery==3.1.24 celery==3.1.24
django-activity-stream==0.7.0 django-activity-stream==0.7.0
django-autoadmin==1.1.1
django-celery==3.2.1 django-celery==3.2.1
django-colorful==1.3 django-colorful==1.3
django-cors-headers==2.5.2 django-cors-headers==2.5.2