Commit 86c7b4e9 by Máhonfai Bálint

Create store for admin users without org id

parent 649c35f4
...@@ -49,9 +49,16 @@ class Store(object): ...@@ -49,9 +49,16 @@ class Store(object):
def __init__(self, user, default_timeout=0.5): def __init__(self, user, default_timeout=0.5):
self.store_url = settings.STORE_URL self.store_url = settings.STORE_URL
if not self.store_url or not user.profile.org_id: if not self.store_url:
raise NoStoreException raise NoStoreException
self.username = 'u-%s' % user.profile.org_id
if user.is_superuser and not user.profile.org_id:
self.username = 'u-admin'
elif not user.profile.org_id:
raise NoStoreException
else:
self.username = 'u-%s' % user.profile.org_id
self.request_args = {'verify': settings.STORE_VERIFY_SSL} self.request_args = {'verify': settings.STORE_VERIFY_SSL}
if settings.STORE_SSL_AUTH: if settings.STORE_SSL_AUTH:
self.request_args['cert'] = (settings.STORE_CLIENT_CERT, self.request_args['cert'] = (settings.STORE_CLIENT_CERT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment