Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
44c47d23
authored
Oct 28, 2019
by
Bálint Máhonfai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get quota from the store if it's already set from another CIRCLE instance
parent
af3811b3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
circle/dashboard/models.py
+11
-5
No files found.
circle/dashboard/models.py
View file @
44c47d23
...
...
@@ -162,7 +162,7 @@ class ConnectCommand(Model):
validators
=
[
connect_command_template_validator
])
class
Meta
:
ordering
=
(
'id'
,
)
ordering
=
(
'id'
,)
def
__unicode__
(
self
):
return
self
.
template
...
...
@@ -263,7 +263,7 @@ class Profile(Model):
super
(
Profile
,
self
)
.
save
(
*
args
,
**
kwargs
)
class
Meta
:
ordering
=
(
'id'
,
)
ordering
=
(
'id'
,)
permissions
=
(
(
'use_autocomplete'
,
_
(
'Can use autocomplete.'
)),
)
...
...
@@ -275,7 +275,7 @@ class FutureMember(Model):
group
=
ForeignKey
(
Group
)
class
Meta
:
ordering
=
(
'id'
,
)
ordering
=
(
'id'
,)
unique_together
=
(
'org_id'
,
'group'
)
def
__unicode__
(
self
):
...
...
@@ -295,7 +295,7 @@ class GroupProfile(AclBase):
description
=
TextField
(
blank
=
True
)
class
Meta
:
ordering
=
(
'id'
,
)
ordering
=
(
'id'
,)
def
__unicode__
(
self
):
return
self
.
group
.
name
...
...
@@ -331,7 +331,11 @@ def create_profile(user):
profile
,
created
=
Profile
.
objects
.
get_or_create
(
user
=
user
)
try
:
Store
(
user
)
.
create_user
(
profile
.
smb_password
,
None
,
profile
.
disk_quota
)
store
=
Store
(
user
)
if
store
.
user_exist
():
profile
.
disk_quota
=
store
.
get_quota
()[
'soft'
]
profile
.
save
()
store
.
create_user
(
profile
.
smb_password
,
None
,
profile
.
disk_quota
)
except
:
logger
.
exception
(
"Can't create user
%
s"
,
unicode
(
user
))
return
created
...
...
@@ -347,6 +351,7 @@ if hasattr(settings, 'SAML_ORG_ID_ATTRIBUTE'):
logger
.
debug
(
"Register save_org_id to djangosaml2 pre_user_save"
)
from
djangosaml2.signals
import
pre_user_save
def
save_org_id
(
sender
,
instance
,
attributes
,
**
kwargs
):
logger
.
debug
(
"save_org_id called by
%
s"
,
instance
.
username
)
atr
=
settings
.
SAML_ORG_ID_ATTRIBUTE
...
...
@@ -399,6 +404,7 @@ if hasattr(settings, 'SAML_ORG_ID_ATTRIBUTE'):
return
False
# User did not change
pre_user_save
.
connect
(
save_org_id
)
...
...
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