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
d23809d9
authored
Jul 28, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ugly way of updating profile and keys for store server
parent
d90632f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletions
+24
-1
circle/dashboard/models.py
+24
-1
No files found.
circle/dashboard/models.py
View file @
d23809d9
...
...
@@ -29,7 +29,7 @@ from django.db.models import (
Model
,
ForeignKey
,
OneToOneField
,
CharField
,
IntegerField
,
TextField
,
DateTimeField
,
permalink
,
BooleanField
)
from
django.db.models.signals
import
post_save
,
pre_delete
from
django.db.models.signals
import
post_save
,
pre_delete
,
post_delete
from
django.templatetags.static
import
static
from
django.utils.translation
import
ugettext_lazy
as
_
from
django_sshkey.models
import
UserKey
...
...
@@ -286,6 +286,29 @@ else:
logger
.
debug
(
"Do not register save_org_id to djangosaml2 pre_user_save"
)
def
update_store_profile
(
sender
,
**
kwargs
):
profile
=
kwargs
.
get
(
'instance'
)
s
=
Store
(
profile
.
user
)
keys
=
[
i
.
key
for
i
in
profile
.
user
.
userkey_set
.
all
()]
s
.
create_user
(
profile
.
smb_password
,
keys
,
profile
.
disk_quota
)
post_save
.
connect
(
update_store_profile
,
sender
=
Profile
)
def
update_store_keys
(
sender
,
**
kwargs
):
userkey
=
kwargs
.
get
(
'instance'
)
profile
=
userkey
.
user
.
profile
keys
=
[
i
.
key
for
i
in
profile
.
user
.
userkey_set
.
all
()]
s
=
Store
(
userkey
.
user
)
s
.
create_user
(
profile
.
smb_password
,
keys
,
profile
.
disk_quota
)
post_save
.
connect
(
update_store_keys
,
sender
=
UserKey
)
post_delete
.
connect
(
update_store_keys
,
sender
=
UserKey
)
def
add_ssh_keys
(
sender
,
**
kwargs
):
from
vm.models
import
Instance
...
...
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