aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-30 19:50:47 +0200
committerGitHub <noreply@github.com>2020-04-30 18:50:47 +0100
commitab69b9b1a60a83cf2b5d6c021da0cb35540df10f (patch)
tree446be5bfe00d6e1da91f848b3ca9710fb1786645 /routers/user
parentc25969e694245ec72c609d3be676b64361e05335 (diff)
downloadgitea-ab69b9b1a60a83cf2b5d6c021da0cb35540df10f.tar.gz
gitea-ab69b9b1a60a83cf2b5d6c021da0cb35540df10f.zip
Refactor UpdateOAuth2Application (#11034)
Following on from #11008 refactor UpdateOAuth2Application
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/setting/oauth2.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/routers/user/setting/oauth2.go b/routers/user/setting/oauth2.go
index 265e32642b..f42c1123e1 100644
--- a/routers/user/setting/oauth2.go
+++ b/routers/user/setting/oauth2.go
@@ -62,7 +62,8 @@ func OAuthApplicationsEdit(ctx *context.Context, form auth.EditOAuth2Application
return
}
// TODO validate redirect URI
- if err := models.UpdateOAuth2Application(models.UpdateOAuth2ApplicationOptions{
+ var err error
+ if ctx.Data["App"], err = models.UpdateOAuth2Application(models.UpdateOAuth2ApplicationOptions{
ID: ctx.ParamsInt64("id"),
Name: form.Name,
RedirectURIs: []string{form.RedirectURI},
@@ -71,11 +72,6 @@ func OAuthApplicationsEdit(ctx *context.Context, form auth.EditOAuth2Application
ctx.ServerError("UpdateOAuth2Application", err)
return
}
- var err error
- if ctx.Data["App"], err = models.GetOAuth2ApplicationByID(ctx.ParamsInt64("id")); err != nil {
- ctx.ServerError("GetOAuth2ApplicationByID", err)
- return
- }
ctx.Flash.Success(ctx.Tr("settings.update_oauth2_application_success"))
ctx.HTML(200, tplSettingsOAuthApplications)
}