Fix invite suggestions.

This commit is contained in:
Pēteris Caune 2020-04-13 12:26:05 +03:00
parent 532b752e3c
commit 3bf1ad9746
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
2 changed files with 12 additions and 5 deletions

View File

@ -172,3 +172,12 @@ class ProjectTestCase(BaseTestCase):
self.project.refresh_from_db()
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="alice@example.org", password="password")
r = self.client.get("/projects/%s/settings/" % p2.code)
self.assertContains(r, "Add Users from Other Teams")
self.assertContains(r, "bob@example.org")

View File

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