storing organization client_id and client_secret in object extras
This commit is contained in:
parent
a5322fb265
commit
55fa9cdaef
|
@ -46,6 +46,7 @@ def valid_signature_required(func):
|
||||||
def create_organization(context, data_dict):
|
def create_organization(context, data_dict):
|
||||||
context['ignore_auth'] = True
|
context['ignore_auth'] = True
|
||||||
model = context['model']
|
model = context['model']
|
||||||
|
session = context['session']
|
||||||
|
|
||||||
destruction_secret = config.get(plugin_config_prefix + 'destruction_secret',
|
destruction_secret = config.get(plugin_config_prefix + 'destruction_secret',
|
||||||
'changeme')
|
'changeme')
|
||||||
|
@ -100,6 +101,12 @@ def create_organization(context, data_dict):
|
||||||
group.state = 'active'
|
group.state = 'active'
|
||||||
group.image_url = default_icon_url
|
group.image_url = default_icon_url
|
||||||
group.save()
|
group.save()
|
||||||
|
model.repo.new_revision()
|
||||||
|
model.GroupExtra(group_id=group.id, key='client_id',
|
||||||
|
value=client_id).save()
|
||||||
|
model.GroupExtra(group_id=group.id, key='client_secret',
|
||||||
|
value=client_secret).save()
|
||||||
|
session.flush()
|
||||||
|
|
||||||
# notify about organization creation
|
# notify about organization creation
|
||||||
services = {'services': [{
|
services = {'services': [{
|
||||||
|
|
Reference in New Issue