api: fix pagination not being required in schema

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-16 17:32:08 +02:00
parent 99be97206b
commit 10cb60f48e
3 changed files with 14 additions and 4 deletions

View File

@ -60,7 +60,17 @@ class Pagination(pagination.PageNumberPagination):
"type": "number", "type": "number",
}, },
}, },
"required": [
"next",
"previous",
"count",
"current",
"total_pages",
"start_index",
"end_index",
]
}, },
"results": schema, "results": schema,
}, },
"required": ["pagination", "results"],
} }

View File

@ -1,4 +1,4 @@
import { CoreApi, Application, ProvidersApi, Provider, PolicyEngineModeEnum } from "authentik-api"; import { CoreApi, Application, ProvidersApi, Provider, PolicyEngineMode } from "authentik-api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { CSSResult, customElement, property } from "lit-element"; import { CSSResult, customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -145,10 +145,10 @@ export class ApplicationForm extends ModelForm<Application, string> {
?required=${true} ?required=${true}
name="policyEngineMode"> name="policyEngineMode">
<select class="pf-c-form-control"> <select class="pf-c-form-control">
<option value=${PolicyEngineModeEnum.Any} ?selected=${this.instance?.policyEngineMode === PolicyEngineModeEnum.Any}> <option value=${PolicyEngineMode.Any} ?selected=${this.instance?.policyEngineMode === PolicyEngineMode.Any}>
${t`ANY, any policy must match to grant access.`} ${t`ANY, any policy must match to grant access.`}
</option> </option>
<option value=${PolicyEngineModeEnum.All} ?selected=${this.instance?.policyEngineMode === PolicyEngineModeEnum.All}> <option value=${PolicyEngineMode.All} ?selected=${this.instance?.policyEngineMode === PolicyEngineMode.All}>
${t`ALL, all policies must match to grant access.`} ${t`ALL, all policies must match to grant access.`}
</option> </option>
</select> </select>

View File

@ -66,7 +66,7 @@ export class CaptchaStageForm extends ModelForm<CaptchaStage, string> {
?required=${true} ?required=${true}
?writeOnly=${this.instance !== undefined} ?writeOnly=${this.instance !== undefined}
name="privateKey"> name="privateKey">
<input type="text" value="${ifDefined(this.instance?.privateKey || "")}" class="pf-c-form-control" required> <input type="text" value="" class="pf-c-form-control" required>
<p class="pf-c-form__helper-text">${t`Private key, acquired from https://www.google.com/recaptcha/intro/v3.html.`}</p> <p class="pf-c-form__helper-text">${t`Private key, acquired from https://www.google.com/recaptcha/intro/v3.html.`}</p>
</ak-form-element-horizontal> </ak-form-element-horizontal>
</div> </div>