diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 1833b3d..b4aad6d 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -591,8 +591,8 @@ def add_issue_dependency( if issue_blocked not in issue.children: i2i = model.IssueToIssue( - parent_issue_id=issue_blocked.uid, - child_issue_id=issue.uid + parent_issue_id=issue.uid, + child_issue_id=issue_blocked.uid ) session.add(i2i) # Make sure we won't have SQLAlchemy error before we continue @@ -645,12 +645,12 @@ def remove_issue_dependency( 'An issue cannot depend on itself' ) - if issue_blocked in issue.children: - child_del = [] - for child in issue.children: - if child.uid == issue_blocked.uid: - child_del.append(child.id) - issue.children.remove(child) + if issue_blocked in issue.parents: + parent_del = [] + for parent in issue.parents: + if parent.uid == issue_blocked.uid: + parent_del.append(parent.id) + issue.parents.remove(parent) # Make sure we won't have SQLAlchemy error before we continue session.flush() @@ -670,7 +670,7 @@ def remove_issue_dependency( msg=dict( issue=issue.to_json(public=True), project=issue.project.to_json(public=True), - removed_dependency=child_del, + removed_dependency=parent_del, agent=user_obj.username, ), redis=REDIS, @@ -679,7 +679,7 @@ def remove_issue_dependency( # Send notification for the event-source server if REDIS: REDIS.publish('pagure.%s' % issue.uid, json.dumps({ - 'removed_dependency': child_del, + 'removed_dependency': parent_del, 'issue_uid': issue.uid, 'type': 'children', })) @@ -690,7 +690,7 @@ def remove_issue_dependency( })) return 'Issue **un**marked as depending on: #%s' % ' #'.join( - [str(id) for id in child_del]) + [str(id) for id in parent_del]) def remove_tags(session, project, tags, ticketfolder, user): diff --git a/pagure/lib/model.py b/pagure/lib/model.py index 4af278d..3651f0e 100644 --- a/pagure/lib/model.py +++ b/pagure/lib/model.py @@ -946,12 +946,12 @@ class Issue(BASE): @property def depending_text(self): ''' Return the list of issue this issue depends on in simple text. ''' - return [issue.id for issue in self.children] + return [issue.id for issue in self.parents] @property def blocking_text(self): ''' Return the list of issue this issue blocks on in simple text. ''' - return [issue.id for issue in self.parents] + return [issue.id for issue in self.children] @property def user_comments(self): diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index bce8b27..36232ad 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -225,7 +225,7 @@
- {% for ticket in issue.parents %} + {% for ticket in issue.children %}
- {% for ticket in issue.children %} + {% for ticket in issue.parents %}