forked from GithubBackups/healthchecks
Don't show the "Sign Up" link in the login page if registration is closed. Fixes #280
This commit is contained in:
parent
9474006d83
commit
dfee69584b
@ -12,7 +12,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
- Fix javascript code to construct correct URLs when running from a subdirectory (#273)
|
- Fix javascript code to construct correct URLs when running from a subdirectory (#273)
|
||||||
|
- Don't show the "Sign Up" link in the login page if registration is closed (#280)
|
||||||
|
|
||||||
## 1.8.0 - 2019-07-08
|
## 1.8.0 - 2019-07-08
|
||||||
|
|
||||||
|
@ -105,3 +105,8 @@ class LoginTestCase(BaseTestCase):
|
|||||||
|
|
||||||
r = self.client.post("/accounts/login/", form)
|
r = self.client.post("/accounts/login/", form)
|
||||||
self.assertContains(r, "Incorrect email or password")
|
self.assertContains(r, "Incorrect email or password")
|
||||||
|
|
||||||
|
@override_settings(REGISTRATION_OPEN=False)
|
||||||
|
def test_it_obeys_registration_open(self):
|
||||||
|
r = self.client.get("/accounts/login/")
|
||||||
|
self.assertNotContains(r, "Create Your Account")
|
||||||
|
@ -132,6 +132,7 @@ def login(request):
|
|||||||
"form": form,
|
"form": form,
|
||||||
"magic_form": magic_form,
|
"magic_form": magic_form,
|
||||||
"bad_link": bad_link,
|
"bad_link": bad_link,
|
||||||
|
"registration_open": settings.REGISTRATION_OPEN,
|
||||||
}
|
}
|
||||||
return render(request, "accounts/login.html", ctx)
|
return render(request, "accounts/login.html", ctx)
|
||||||
|
|
||||||
|
@ -89,17 +89,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if registration_open %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="login-signup-cta" class="col-sm-12 text-center">
|
<div id="login-signup-cta" class="col-sm-12 text-center">
|
||||||
Don't have an account?
|
Don't have an account?
|
||||||
<a href="#" data-toggle="modal" data-target="#signup-modal">Sign Up</a>
|
<a href="#" data-toggle="modal" data-target="#signup-modal">Sign Up</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if registration_open %}
|
||||||
{% include "front/signup_modal.html" %}
|
{% include "front/signup_modal.html" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user