Commit 37c4a08f authored by Michal Čihař's avatar Michal Čihař

Merge remote-tracking branch 'origin/master'

parents 0087ab22 1170c99c
......@@ -23,6 +23,9 @@ case "$1" in
echo 'Creating database for Weblate'
su - wwwrun -s /bin/bash -c '/usr/share/weblate/manage.py syncdb --noinput'
rc_status -v -r
echo 'Updating database for Weblate'
su - wwwrun -s /bin/bash -c '/usr/share/weblate/manage.py migrate'
rc_status -v -r
echo 'Adding admin user for Weblate'
su - wwwrun -s /bin/bash -c '/usr/share/weblate/manage.py createadmin'
rc_status -v -r
......
......@@ -7,6 +7,11 @@ from django.db import models
class Migration(SchemaMigration):
depends_on = (
('weblate.lang', '0001_initial'),
('weblate.trans', '0001_initial'),
)
def forwards(self, orm):
# Adding model 'Profile'
db.create_table('accounts_profile', (
......
......@@ -4,6 +4,7 @@ from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.db.models.signals import post_save
from django.db.utils import DatabaseError
from django.utils.translation import ugettext_lazy as _, gettext, ugettext_noop
from django.contrib import messages
from django.contrib.auth.models import Group, Permission, User
......@@ -209,9 +210,13 @@ def create_profile_callback(sender, **kwargs):
'''
if kwargs['created']:
# Create profile
try:
profile, newprofile = Profile.objects.get_or_create(user = kwargs['instance'])
if newprofile:
profile.save
except DatabaseError:
# Database not set up (we're being run from initial syncdb)
pass
# Add user to Users group if it exists
try:
......
......@@ -7,6 +7,10 @@ from django.db import models
class Migration(SchemaMigration):
depends_on = (
('weblate.lang', '0001_initial'),
)
def forwards(self, orm):
# Adding model 'Project'
db.create_table('trans_project', (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment