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
|
||||
- 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
|
||||
|
||||
|
@ -105,3 +105,8 @@ class LoginTestCase(BaseTestCase):
|
||||
|
||||
r = self.client.post("/accounts/login/", form)
|
||||
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,
|
||||
"magic_form": magic_form,
|
||||
"bad_link": bad_link,
|
||||
"registration_open": settings.REGISTRATION_OPEN,
|
||||
}
|
||||
return render(request, "accounts/login.html", ctx)
|
||||
|
||||
|
@ -89,17 +89,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if registration_open %}
|
||||
<div class="row">
|
||||
<div id="login-signup-cta" class="col-sm-12 text-center">
|
||||
Don't have an account?
|
||||
<a href="#" data-toggle="modal" data-target="#signup-modal">Sign Up</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if registration_open %}
|
||||
{% include "front/signup_modal.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user