Browse Source

Fix invite suggestions.

pull/360/head
Pēteris Caune 5 years ago
parent
commit
3bf1ad9746
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 12 additions and 5 deletions
  1. +9
    -0
      hc/accounts/tests/test_project.py
  2. +3
    -5
      templates/accounts/project.html

+ 9
- 0
hc/accounts/tests/test_project.py View File

@ -172,3 +172,12 @@ class ProjectTestCase(BaseTestCase):
self.project.refresh_from_db() self.project.refresh_from_db()
self.assertEqual(self.project.name, "Alpha Team") self.assertEqual(self.project.name, "Alpha Team")
def test_it_shows_invite_suggestions(self):
p2 = Project.objects.create(owner=self.alice)
self.client.login(username="[email protected]", password="password")
r = self.client.get("/projects/%s/settings/" % p2.code)
self.assertContains(r, "Add Users from Other Teams")
self.assertContains(r, "[email protected]")

+ 3
- 5
templates/accounts/project.html View File

@ -135,6 +135,7 @@
{% endif %} {% endif %}
</div> </div>
{% with invite_suggestions=project.invite_suggestions %}
<div class="panel panel-{{ team_status|default:'default' }}"> <div class="panel panel-{{ team_status|default:'default' }}">
<div class="panel-body settings-block"> <div class="panel-body settings-block">
<h2>Team Access</h2> <h2>Team Access</h2>
@ -165,9 +166,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
{% if is_owner %}
{% with invite_suggestions=project.invite_suggestions %}
{% if invite_suggestions %}
{% if is_owner and invite_suggestions %}
<tr id="suggestions-row"> <tr id="suggestions-row">
<td colspan="3"> <td colspan="3">
Add Users from Other Teams Add Users from Other Teams
@ -187,8 +186,6 @@
</tr> </tr>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endwith %}
{% endif %}
</table> </table>
{% else %} {% else %}
<p> <p>
@ -216,6 +213,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
{% endwith %}
{% if team_member_invited %} {% if team_member_invited %}
<div class="panel-footer"> <div class="panel-footer">


Loading…
Cancel
Save