From 4a4505d042dfec01e7c01a30e7daa6eae9662dc5 Mon Sep 17 00:00:00 2001 From: Simon Martens Date: Thu, 29 May 2025 00:32:09 +0200 Subject: [PATCH] test superuser creation bug --- app/pb.go | 6 ++- views/routes/almanach/body.gohtml | 88 +++++++++++++++++-------------- 2 files changed, 51 insertions(+), 43 deletions(-) diff --git a/app/pb.go b/app/pb.go index ef7cffc..72015b3 100644 --- a/app/pb.go +++ b/app/pb.go @@ -89,9 +89,9 @@ func (app *App) setupTestuser() BootFunc { } superuser, err := e.App.FindAuthRecordByEmail(superusersCol, TEST_SUPERUSER_MAIL) - if err != nil { + if err != nil && app.MAConfig.AllowTestLogin { 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 _, err = e.App.DB(). 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 nil + } else if err != nil { return nil } diff --git a/views/routes/almanach/body.gohtml b/views/routes/almanach/body.gohtml index eadde03..00850b8 100644 --- a/views/routes/almanach/body.gohtml +++ b/views/routes/almanach/body.gohtml @@ -114,51 +114,57 @@
{{- if gt (len $model.result.Types) 1 -}}
- - +
+ + + +
{{- end -}} {{- if $model.result.HasScans -}}
- - +
+ + + +
{{- end -}}