Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9edce25a
authored
Jul 28, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error on user delete
parent
c0d687db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
circle/dashboard/models.py
+5
-2
No files found.
circle/dashboard/models.py
View file @
9edce25a
...
@@ -33,6 +33,7 @@ from django.db.models.signals import post_save, pre_delete, post_delete
...
@@ -33,6 +33,7 @@ from django.db.models.signals import post_save, pre_delete, post_delete
from
django.templatetags.static
import
static
from
django.templatetags.static
import
static
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
django_sshkey.models
import
UserKey
from
django_sshkey.models
import
UserKey
from
django.core.exceptions
import
ObjectDoesNotExist
from
sizefield.models
import
FileSizeField
from
sizefield.models
import
FileSizeField
...
@@ -295,7 +296,6 @@ def update_store_profile(sender, **kwargs):
...
@@ -295,7 +296,6 @@ def update_store_profile(sender, **kwargs):
profile
.
disk_quota
)
profile
.
disk_quota
)
except
NoStoreException
:
except
NoStoreException
:
logger
.
debug
(
"Store is not available."
)
logger
.
debug
(
"Store is not available."
)
pass
post_save
.
connect
(
update_store_profile
,
sender
=
Profile
)
post_save
.
connect
(
update_store_profile
,
sender
=
Profile
)
...
@@ -303,7 +303,11 @@ post_save.connect(update_store_profile, sender=Profile)
...
@@ -303,7 +303,11 @@ post_save.connect(update_store_profile, sender=Profile)
def
update_store_keys
(
sender
,
**
kwargs
):
def
update_store_keys
(
sender
,
**
kwargs
):
userkey
=
kwargs
.
get
(
'instance'
)
userkey
=
kwargs
.
get
(
'instance'
)
try
:
profile
=
userkey
.
user
.
profile
profile
=
userkey
.
user
.
profile
except
ObjectDoesNotExist
:
pass
# If there is no profile the user is deleted
else
:
keys
=
[
i
.
key
for
i
in
profile
.
user
.
userkey_set
.
all
()]
keys
=
[
i
.
key
for
i
in
profile
.
user
.
userkey_set
.
all
()]
try
:
try
:
s
=
Store
(
userkey
.
user
)
s
=
Store
(
userkey
.
user
)
...
@@ -311,7 +315,6 @@ def update_store_keys(sender, **kwargs):
...
@@ -311,7 +315,6 @@ def update_store_keys(sender, **kwargs):
profile
.
disk_quota
)
profile
.
disk_quota
)
except
NoStoreException
:
except
NoStoreException
:
logger
.
debug
(
"Store is not available."
)
logger
.
debug
(
"Store is not available."
)
pass
post_save
.
connect
(
update_store_keys
,
sender
=
UserKey
)
post_save
.
connect
(
update_store_keys
,
sender
=
UserKey
)
...
...
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