fix table sizing on bootstrap 4; fix profile application on single-use

invites

use table-sm and no form-check-input so profile menu looks normal on
bs4. Profile was being read after being marked as used on invites, so
single-use invites were deleted and no profile was applied.
This commit is contained in:
Harvey Tindall
2020-09-23 19:12:58 +01:00
parent 89e70f6f7a
commit 9bd7fca95e
5 changed files with 11 additions and 9 deletions
+3 -1
View File
@@ -271,8 +271,9 @@ func (app *appContext) NewUser(gc *gin.Context) {
respond(401, "Unknown error", gc)
return
}
app.checkInvite(req.Code, true, req.Username)
app.storage.loadProfiles()
invite := app.storage.invites[req.Code]
app.checkInvite(req.Code, true, req.Username)
if app.config.Section("notifications").Key("enabled").MustBool(false) {
for address, settings := range invite.Notify {
if settings["notify-creation"] {
@@ -296,6 +297,7 @@ func (app *appContext) NewUser(gc *gin.Context) {
id = user["Id"].(string)
}
if invite.Profile != "" {
app.debug.Printf("Applying settings from profile \"%s\"", invite.Profile)
profile, ok := app.storage.profiles[invite.Profile]
if !ok {
profile = app.storage.profiles["Default"]