Commit 3195f9c8 authored by Giannis Tsapelas's avatar Giannis Tsapelas
Browse files

keycloak init fix

parent 79c5b3d5
Pipeline #2759 failed with stages
in 25 minutes and 51 seconds
......@@ -12,24 +12,21 @@ class Command(BaseCommand):
def handle(self, *args, **options):
try:
s = Server.objects.first()
except:
s = Server.objects.first()
if s is None:
s = Server()
s.url = os.environ.get("KEYCLOAK_SERVER_URL")
s.save()
try:
r = Realm.objects.first()
except:
r = Realm.objects.first()
if r is None:
r = Realm()
r.server = s
r.name = os.environ.get("KEYCLOAK_REALM")
r.save()
try:
c = Client.objects.first()
except:
c = Client.objects.first()
if c is None:
c = Client()
c.realm = r
c.client_id = os.environ.get("KEYCLOAK_CLIENT_ID")
......
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 to comment