Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
747fa609
Commit
747fa609
authored
Jul 30, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not fail syncdb and creating user if backend database is not ready
parent
9dc327a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
weblate/accounts/models.py
weblate/accounts/models.py
+8
-3
No files found.
weblate/accounts/models.py
View file @
747fa609
...
@@ -4,6 +4,7 @@ from django.contrib.auth.models import User
...
@@ -4,6 +4,7 @@ from django.contrib.auth.models import User
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth.signals
import
user_logged_in
from
django.contrib.auth.signals
import
user_logged_in
from
django.db.models.signals
import
post_save
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.utils.translation
import
ugettext_lazy
as
_
,
gettext
,
ugettext_noop
from
django.contrib
import
messages
from
django.contrib
import
messages
from
django.contrib.auth.models
import
Group
,
Permission
,
User
from
django.contrib.auth.models
import
Group
,
Permission
,
User
...
@@ -209,9 +210,13 @@ def create_profile_callback(sender, **kwargs):
...
@@ -209,9 +210,13 @@ def create_profile_callback(sender, **kwargs):
'''
'''
if
kwargs
[
'created'
]:
if
kwargs
[
'created'
]:
# Create profile
# Create profile
profile
,
newprofile
=
Profile
.
objects
.
get_or_create
(
user
=
kwargs
[
'instance'
])
try
:
if
newprofile
:
profile
,
newprofile
=
Profile
.
objects
.
get_or_create
(
user
=
kwargs
[
'instance'
])
profile
.
save
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
# Add user to Users group if it exists
try
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment