mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 21:03:22 +00:00
Fixup behavior on uninstalled state
This commit is contained in:
@@ -47,7 +47,7 @@ func Index(w http.ResponseWriter, r *http.Request) error {
|
||||
|
||||
// Return an HTML form for the User to login.
|
||||
func Login(w http.ResponseWriter, r *http.Request) error {
|
||||
var settings = database.SettingsMust()
|
||||
var settings, _ = database.GetSettings()
|
||||
|
||||
data := struct {
|
||||
Settings *Settings
|
||||
@@ -78,10 +78,13 @@ func Reset(w http.ResponseWriter, r *http.Request) error {
|
||||
|
||||
// Return an HTML form for the User to signup.
|
||||
func SignUp(w http.ResponseWriter, r *http.Request) error {
|
||||
if !database.SettingsMust().OpenInvitations {
|
||||
var settings, _ = database.GetSettings()
|
||||
|
||||
if settings == nil || !settings.OpenInvitations {
|
||||
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
||||
return nil
|
||||
}
|
||||
|
||||
return RenderTemplate(w, "signup.html", nil)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user