mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
Fixup behavior on uninstalled state
This commit is contained in:
parent
0bd8ef28dd
commit
460ec90049
2 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<input type="submit" value="Sign in" />
|
||||
</div>
|
||||
<div>
|
||||
{{ if .Settings.OpenInvitations }}
|
||||
<a href="/signup">request invitation</a>
|
||||
{{ if .Settings ne nil and .Settings.OpenInvitations }}
|
||||
<a href="/signup">request invitation</a> ·
|
||||
{{ end }}
|
||||
<a href="/forgot">forgot password</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue