From 7c417bbb0d8f3213f34db50f62013e20492d044f Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Tue, 5 Sep 2017 15:45:18 +0200 Subject: Only check at least one email gpg key (#2266) * Only require one email (possibly not yet validated) * Update message error and check validation of commit * Add integrations tests * Complete integration for import * Add pre-check/optimization * Add some test (not finished) * Finish * Fix fixtures * Fix typo * Don't guess key ID --- routers/user/setting.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'routers/user') diff --git a/routers/user/setting.go b/routers/user/setting.go index b94f7dfb73..2c951eaf5f 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -378,9 +378,9 @@ func SettingsKeysPost(ctx *context.Context, form auth.AddKeyForm) { case models.IsErrGPGKeyIDAlreadyUsed(err): ctx.Data["Err_Content"] = true ctx.RenderWithErr(ctx.Tr("settings.gpg_key_id_used"), tplSettingsKeys, &form) - case models.IsErrGPGEmailNotFound(err): + case models.IsErrGPGNoEmailFound(err): ctx.Data["Err_Content"] = true - ctx.RenderWithErr(ctx.Tr("settings.gpg_key_email_not_found", err.(models.ErrGPGEmailNotFound).Email), tplSettingsKeys, &form) + ctx.RenderWithErr(ctx.Tr("settings.gpg_no_key_email_found"), tplSettingsKeys, &form) default: ctx.Handle(500, "AddPublicKey", err) } -- cgit v1.2.3