Merge branch 'development' into feature/multi-tenant
This commit is contained in:
@@ -68,10 +68,10 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{% if not user.is_authenticated %}
|
||||
{% if not request.user.is_authenticated %}
|
||||
{% trans 'Anonymous' %}
|
||||
{% else %}
|
||||
<li><a href="{% url 'common:current_user_details' %}" title="{% trans 'User details' %}">{{ request.organization }}: {{ user.get_full_name|default:user }} <i class="fa fa-user"></i></a></li>
|
||||
<li><a href="{% url 'common:current_user_details' %}" title="{% trans 'User details' %}">{{ request.organization }}: {{ request.user.get_full_name|default:request.user }} <i class="fa fa-user"></i></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@ class Command(management.BaseCommand):
|
||||
def handle(self, *args, **options):
|
||||
path = os.path.join(settings.BASE_DIR, 'mayan', 'settings', 'local.py')
|
||||
if os.path.exists(path):
|
||||
print 'Existing file at: {0}. Backup, remove this file and try again.'.format(path)
|
||||
self.stdout.write(self.style.NOTICE('Existing settings file at: {0}. Backup, remove this file, and try again.'.format(path)))
|
||||
else:
|
||||
with open(path, 'w+') as file_object:
|
||||
file_object.write('\n'.join([
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core import management
|
||||
from django.db.utils import OperationalError
|
||||
|
||||
from ...signals import post_initial_setup
|
||||
|
||||
|
||||
class Command(management.BaseCommand):
|
||||
help = 'Gets Mayan EDMS ready to be used.'
|
||||
help = 'Initializes an install and gets it ready to be used.'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
management.call_command('createsettings', interactive=False)
|
||||
management.call_command('migrate', interactive=False)
|
||||
try:
|
||||
result = management.call_command('migrate', interactive=False)
|
||||
except OperationalError as exception:
|
||||
self.stderr.write(self.style.NOTICE('Unable to migrate the database. The initialsetup command is to be used only on new installations. To upgrade existing installations use the performupgrade command.'))
|
||||
raise
|
||||
management.call_command('createautoadmin', interactive=False)
|
||||
management.call_command('createorganizationadmin', interactive=False)
|
||||
post_initial_setup.send(sender=self)
|
||||
|
||||
Reference in New Issue
Block a user