mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
test superuser creation bug
This commit is contained in:
@@ -89,9 +89,9 @@ func (app *App) setupTestuser() BootFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
superuser, err := e.App.FindAuthRecordByEmail(superusersCol, TEST_SUPERUSER_MAIL)
|
superuser, err := e.App.FindAuthRecordByEmail(superusersCol, TEST_SUPERUSER_MAIL)
|
||||||
if err != nil {
|
if err != nil && app.MAConfig.AllowTestLogin {
|
||||||
superuser = core.NewRecord(superusersCol)
|
superuser = core.NewRecord(superusersCol)
|
||||||
} else if !app.MAConfig.AllowTestLogin {
|
} else if err == nil && !app.MAConfig.AllowTestLogin {
|
||||||
// INFO: we to it as a raw query here since PB does not support deleting the last superuser
|
// INFO: we to it as a raw query here since PB does not support deleting the last superuser
|
||||||
_, err = e.App.DB().
|
_, err = e.App.DB().
|
||||||
NewQuery("DELETE FROM " + superusersCol.Name + " WHERE id = '" + superuser.Id + "'").
|
NewQuery("DELETE FROM " + superusersCol.Name + " WHERE id = '" + superuser.Id + "'").
|
||||||
@@ -100,6 +100,8 @@ func (app *App) setupTestuser() BootFunc {
|
|||||||
return fmt.Errorf("Failed to delete superuser account: %w.", err)
|
return fmt.Errorf("Failed to delete superuser account: %w.", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
} else if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,51 +114,57 @@
|
|||||||
<div class="flex flex-row justify-end">
|
<div class="flex flex-row justify-end">
|
||||||
{{- if gt (len $model.result.Types) 1 -}}
|
{{- if gt (len $model.result.Types) 1 -}}
|
||||||
<div>
|
<div>
|
||||||
<label
|
<form
|
||||||
for="typefilter"
|
method="GET"
|
||||||
class="align-baseline h-min self-end pb-1 mr-1.5 text-sm font-sans text-stone-700">
|
hx-boost="false"
|
||||||
Kategorie
|
x-target="almanachcontents"
|
||||||
</label>
|
aria-label="Filter für Beitragstypen">
|
||||||
<select
|
<label
|
||||||
class="h-min pb-1 border-b-4 border-zinc-300 px-1.5 mr-8"
|
for="typefilter"
|
||||||
name="typefilter"
|
class="align-baseline h-min self-end pb-1 mr-1.5 text-sm font-sans text-stone-700">
|
||||||
id="typefilter"
|
Kategorie
|
||||||
autocomplete="off"
|
</label>
|
||||||
hx-get="./"
|
<select
|
||||||
trigger="change"
|
class="h-min pb-1 border-b-4 border-zinc-300 px-1.5 mr-8"
|
||||||
hx-indicator="body"
|
name="typefilter"
|
||||||
hx-select="#almanachcontents"
|
id="typefilter"
|
||||||
hx-target="#almanachcontents"
|
autocomplete="off"
|
||||||
hx-swap="outerHTML show:none">
|
@change.debounce="$el.form.requestSubmit()">
|
||||||
<option value="">Alle</option>
|
<option value="">Alle</option>
|
||||||
{{- range $i, $t := $model.result.Types -}}
|
{{- range $i, $t := $model.result.Types -}}
|
||||||
<option value="{{- $t -}}" {{- if eq $model.filters.Type $t -}}selected{{- end -}}>
|
<option
|
||||||
{{- $t -}}
|
value="{{- $t -}}"
|
||||||
</option>
|
{{- if eq $model.filters.Type $t -}}selected{{- end -}}>
|
||||||
{{- end -}}
|
{{- $t -}}
|
||||||
</select>
|
</option>
|
||||||
|
{{- end -}}
|
||||||
|
</select>
|
||||||
|
<button x-show="false">Filtern</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if $model.result.HasScans -}}
|
{{- if $model.result.HasScans -}}
|
||||||
<div>
|
<div>
|
||||||
<label
|
<form
|
||||||
for="onlyscans"
|
method="GET"
|
||||||
class="align-baseline h-min self-end pb-1 mr-1.5 text-sm font-sans text-stone-700">
|
hx-boost="false"
|
||||||
Nur Digitalisate anzeigen
|
x-target="almanachcontents"
|
||||||
</label>
|
aria-label="Filter für digialisierte Beiträge">
|
||||||
<input
|
<label
|
||||||
class=""
|
for="onlyscans"
|
||||||
type="checkbox"
|
class="align-baseline h-min self-end pb-1 mr-1.5 text-sm font-sans text-stone-700">
|
||||||
id="onlyscans"
|
Nur Digitalisate anzeigen
|
||||||
name="onlyscans"
|
</label>
|
||||||
autocomplete="off"
|
<input
|
||||||
hx-get="./"
|
class=""
|
||||||
trigger="change"
|
type="checkbox"
|
||||||
hx-select="#almanachcontents"
|
id="onlyscans"
|
||||||
hx-target="#almanachcontents"
|
name="onlyscans"
|
||||||
hx-swap="outerHTML show:none"
|
autocomplete="off"
|
||||||
hx-indicator="body"
|
@change.debounce="$el.form.requestSubmit()"
|
||||||
{{ if $model.filters.OnlyScans -}}checked{{- end -}} />
|
{{ if $model.filters.OnlyScans -}}checked{{- end -}} />
|
||||||
|
<button x-show="false">Filtern</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user