fix stuff I broke

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt 2023-12-07 10:10:09 +01:00
parent 75d4cdb40b
commit 526cadcd09
No known key found for this signature in database
GPG key ID: 9C3FA22FABF1AA8D
5 changed files with 40 additions and 18 deletions

View file

@ -56,7 +56,6 @@ SHARED_APPS = [
"django_tenants",
"authentik.tenants",
"daphne",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.humanize",
@ -68,6 +67,7 @@ SHARED_APPS = [
]
TENANT_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"authentik.admin",
"authentik.api",

View file

@ -39,6 +39,7 @@ class TenantSerializer(ModelSerializer):
"tenant_uuid",
"schema_name",
"name",
"ready",
]
@ -111,7 +112,7 @@ class SettingsSerializer(ModelSerializer):
class SettingsView(RetrieveUpdateAPIView):
"""Settings view"""
queryset = Tenant.objects.all()
queryset = Tenant.objects.filter(ready=True)
serializer_class = SettingsSerializer
permission_classes = [IsAdminUser]
filter_backends = []

View file

@ -4,19 +4,10 @@ from rest_framework.test import APITransactionTestCase
class TenantAPITestCase(APITransactionTestCase):
# Overridden to force TRUNCATE CASCADE
# Overridden to also remove additional schemas we may have created
def _fixture_teardown(self):
super()._fixture_teardown()
for db_name in self._databases_names(include_mirrors=False):
call_command(
"flush",
verbosity=0,
interactive=False,
database=db_name,
reset_sequences=False,
allow_cascade=True,
inhibit_post_migrate=False,
)
with connections[db_name].cursor() as cursor:
cursor.execute(
"SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname !~ 'pg_*' AND nspname != 'information_schema' AND nspname != 'public' AND nspname != 'template'"

View file

@ -2908,6 +2908,10 @@
"type": "string",
"minLength": 1,
"title": "Name"
},
"ready": {
"type": "boolean",
"title": "Ready"
}
},
"required": []

View file

@ -6374,6 +6374,11 @@ paths:
name: action
schema:
type: string
- in: query
name: brand_name
schema:
type: string
description: Brand name
- in: query
name: client_ip
schema:
@ -6410,11 +6415,6 @@ paths:
description: A search term.
schema:
type: string
- in: query
name: tenant_name
schema:
type: string
description: Tenant name
- in: query
name: username
schema:
@ -33502,6 +33502,10 @@ components:
type: string
icon:
type: string
nullable: true
description: |-
Get the URL to the Icon. If the name is /static or
starts with http it is returned as-is
readOnly: true
server_uri:
type: string
@ -34691,6 +34695,10 @@ components:
type: string
icon:
type: string
nullable: true
description: |-
Get the URL to the Icon. If the name is /static or
starts with http it is returned as-is
readOnly: true
provider_type:
$ref: '#/components/schemas/ProviderTypeEnum'
@ -38773,6 +38781,8 @@ components:
name:
type: string
minLength: 1
ready:
type: boolean
PatchedTokenRequest:
type: object
description: Token Serializer
@ -39099,6 +39109,10 @@ components:
type: string
icon:
type: string
nullable: true
description: |-
Get the URL to the Icon. If the name is /static or
starts with http it is returned as-is
readOnly: true
client_id:
type: string
@ -41045,6 +41059,10 @@ components:
type: string
icon:
type: string
nullable: true
description: |-
Get the URL to the Icon. If the name is /static or
starts with http it is returned as-is
readOnly: true
pre_authentication_flow:
type: string
@ -41778,6 +41796,10 @@ components:
type: string
icon:
type: string
nullable: true
description: |-
Get the URL to the Icon. If the name is /static or
starts with http it is returned as-is
readOnly: true
required:
- component
@ -42180,6 +42202,8 @@ components:
maxLength: 63
name:
type: string
ready:
type: boolean
required:
- name
- schema_name
@ -42195,6 +42219,8 @@ components:
name:
type: string
minLength: 1
ready:
type: boolean
required:
- name
- schema_name