forked from GithubBackups/healthchecks
Improve copy in "Profile" > "Email and Password" section
When an account has a password, replace "Set Password" button's label with "Change Password"
This commit is contained in:
parent
6d2c67338c
commit
6ed983cdd5
@ -9,6 +9,7 @@ class ProfileTestCase(BaseTestCase):
|
|||||||
|
|
||||||
r = self.client.get("/accounts/profile/")
|
r = self.client.get("/accounts/profile/")
|
||||||
self.assertContains(r, "Email and Password")
|
self.assertContains(r, "Email and Password")
|
||||||
|
self.assertContains(r, "Change Password")
|
||||||
|
|
||||||
def test_leaving_works(self):
|
def test_leaving_works(self):
|
||||||
self.client.login(username="bob@example.org", password="password")
|
self.client.login(username="bob@example.org", password="password")
|
||||||
@ -75,3 +76,15 @@ class ProfileTestCase(BaseTestCase):
|
|||||||
self.client.login(username="alice@example.org", password="password")
|
self.client.login(username="alice@example.org", password="password")
|
||||||
r = self.client.get("/accounts/profile/")
|
r = self.client.get("/accounts/profile/")
|
||||||
self.assertContains(r, "Alices Key")
|
self.assertContains(r, "Alices Key")
|
||||||
|
|
||||||
|
def test_it_handles_unusable_password(self):
|
||||||
|
self.alice.set_unusable_password()
|
||||||
|
self.alice.save()
|
||||||
|
|
||||||
|
# Authenticate using the ProfileBackend and a token:
|
||||||
|
token = self.profile.prepare_token("login")
|
||||||
|
self.client.login(username="alice", token=token)
|
||||||
|
|
||||||
|
r = self.client.get("/accounts/profile/")
|
||||||
|
self.assertContains(r, "Set Password")
|
||||||
|
self.assertNotContains(r, "Change Password")
|
||||||
|
@ -65,3 +65,7 @@ span.loading {
|
|||||||
#my-keys th {
|
#my-keys th {
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-bar {
|
||||||
|
line-height: 34px;
|
||||||
|
}
|
@ -38,7 +38,7 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<h2>Email and Password</h2>
|
<h2>Email and Password</h2>
|
||||||
<p>
|
<p class="settings-bar">
|
||||||
Your account's email address is
|
Your account's email address is
|
||||||
<code>{{ request.user.email }}</code>
|
<code>{{ request.user.email }}</code>
|
||||||
|
|
||||||
@ -47,12 +47,21 @@
|
|||||||
class="btn btn-default pull-right">Change Email</a>
|
class="btn btn-default pull-right">Change Email</a>
|
||||||
</p>
|
</p>
|
||||||
<p class="clearfix"></p>
|
<p class="clearfix"></p>
|
||||||
<p>
|
{% if request.user.has_usable_password %}
|
||||||
Attach a password to your {{ site_name }} account
|
<p class="settings-bar">
|
||||||
|
Password authentication is enabled.
|
||||||
|
<a
|
||||||
|
href="{% url 'hc-set-password' %}"
|
||||||
|
class="btn btn-default pull-right">Change Password</a>
|
||||||
|
</p>
|
||||||
|
{% else %}
|
||||||
|
<p class="settings-bar">
|
||||||
|
Attach a password to your {{ site_name }} account.
|
||||||
<a
|
<a
|
||||||
href="{% url 'hc-set-password' %}"
|
href="{% url 'hc-set-password' %}"
|
||||||
class="btn btn-default pull-right">Set Password</a>
|
class="btn btn-default pull-right">Set Password</a>
|
||||||
</p>
|
</p>
|
||||||
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% if changed_password %}
|
{% if changed_password %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user