From 300f0f5971a0d75e5c1372321ded6f0065bde826 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Jan 12 2017 15:50:57 +0000 Subject: Extended the user issue page to include issues that are assigned (not just opened by) --- diff --git a/pagure/templates/user_issues.html b/pagure/templates/user_issues.html index 49b70d2..470f7a2 100644 --- a/pagure/templates/user_issues.html +++ b/pagure/templates/user_issues.html @@ -1,13 +1,13 @@ {% extends "master.html" %} -{% block title %}Issues opened by {{ username }}{% endblock %} +{% block title %}Issues for {{ username }}{% endblock %} {% block content %}

- Issues opened by {{ username | avatar(20) | safe }} {{ username }} + Issues for {{ username | avatar(20) | safe }} {{ username }}

@@ -16,7 +16,17 @@ All
- +
+ + {% set opened = true %} + {% for issues in (user.issues, user.assigned_issues) %} + {% if opened == true %} + Opened Issues + {% set opened = false %} + {% else %} + Assigned Issues + {% endif %} +
@@ -24,13 +34,14 @@ + - {% for issue in user.issues %} + {% for issue in issues %} @@ -69,6 +80,10 @@ + {% endfor %} -
#Title Opened ProjectCreated by Assigned to
+ +
+ {% endfor %}
diff --git a/tests/test_pagure_flask_ui_app.py b/tests/test_pagure_flask_ui_app.py index a5d0207..ede4d3a 100644 --- a/tests/test_pagure_flask_ui_app.py +++ b/tests/test_pagure_flask_ui_app.py @@ -1048,14 +1048,35 @@ class PagureFlaskApptests(tests.Modeltests): self.session.commit() self.assertEqual(msg.title, 'Test issue #2') + # Test the assigned issue table. Create issue then set the assignee + msg = pagure.lib.new_issue( + session=self.session, + repo=repo, + title='Test issue #3', + content='This issue created by foo, but assigned to pingou', + user='foo', + status='Open', + ticketfolder=None + ) + self.session.commit() + self.assertEqual(msg.title, 'Test issue #3') + + msg = pagure.lib.add_issue_assignee( + session=self.session, + issue=msg, + assignee='pingou', + user='foo', + ticketfolder=None) + self.session.commit() + self.assertEqual(msg, 'Issue assigned') output = self.app.get('/user/pingou/issues') self.assertEqual(output.status_code, 200) self.assertIn('Test issue #1', output.data) self.assertIn('Test issue #2', output.data) + self.assertIn('Test issue #3', output.data) self.assertEqual( - output.data.count('