diff --git a/pagure/forms.py b/pagure/forms.py index 1707da8..8623d76 100644 --- a/pagure/forms.py +++ b/pagure/forms.py @@ -316,11 +316,11 @@ class UpdateIssueForm(PagureForm): wtforms.validators.Length(max=255), ] ) - depends = wtforms.TextField( - 'dependency issue', [wtforms.validators.Optional()] + depending = wtforms.TextField( + 'depending issue', [wtforms.validators.Optional()] ) - blocks = wtforms.TextField( - 'blocked issue', [wtforms.validators.Optional()] + blocking = wtforms.TextField( + 'blocking issue', [wtforms.validators.Optional()] ) comment = wtforms.TextAreaField( 'Comment', [wtforms.validators.Optional()] diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index a4d2b42..53d395d 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -2762,8 +2762,8 @@ def update_dependency_issue( if isinstance(depends, basestring): depends = [depends] - toadd = set(depends) - set(issue.depends_text) - torm = set(issue.depends_text) - set(depends) + toadd = set(depends) - set(issue.depending_text) + torm = set(issue.depending_text) - set(depends) messages = [] # Add issue depending @@ -2772,7 +2772,7 @@ def update_dependency_issue( issue_depend = search_issues(session, repo, issueid=depend) if issue_depend is None: continue - if issue_depend.id in issue.depends_text: # pragma: no cover + if issue_depend.id in issue.depending_text: # pragma: no cover # we should never be in this case but better safe than sorry... continue @@ -2792,7 +2792,7 @@ def update_dependency_issue( # We cannot test this as it would mean we managed to put in an # invalid ticket as dependency earlier continue - if issue_depend.id not in issue.depends_text: # pragma: no cover + if issue_depend.id not in issue.depending_text: # pragma: no cover # we should never be in this case but better safe than sorry... continue @@ -2817,17 +2817,17 @@ def update_blocked_issue( if isinstance(blocks, basestring): blocks = [blocks] - toadd = set(blocks) - set(issue.blocks_text) - torm = set(issue.blocks_text) - set(blocks) + toadd = set(blocks) - set(issue.blocking_text) + torm = set(issue.blocking_text) - set(blocks) messages = [] # Add issue blocked for block in sorted([int(i) for i in toadd]): - messages.append("Issue marked as blocked by: #%s" % block) + messages.append("Issue marked as blocking: #%s" % block) issue_block = search_issues(session, repo, issueid=block) if issue_block is None: continue - if issue_block.id in issue.blocks_text: # pragma: no cover + if issue_block.id in issue.blocking_text: # pragma: no cover # we should never be in this case but better safe than sorry... continue @@ -2842,14 +2842,14 @@ def update_blocked_issue( # Remove issue blocked for block in sorted([int(i) for i in torm]): - messages.append("Issue **un**marked as blocked by: #%s" % block) + messages.append("Issue **un**marked as blocking: #%s" % block) issue_block = search_issues(session, repo, issueid=block) if issue_block is None: # pragma: no cover # We cannot test this as it would mean we managed to put in an # invalid ticket as dependency earlier continue - if issue_block.id not in issue.blocks_text: # pragma: no cover + if issue_block.id not in issue.blocking_text: # pragma: no cover # we should never be in this case but better safe than sorry... continue diff --git a/pagure/lib/model.py b/pagure/lib/model.py index 0414aa7..4af278d 100644 --- a/pagure/lib/model.py +++ b/pagure/lib/model.py @@ -944,12 +944,12 @@ class Issue(BASE): return [tag.tag for tag in self.tags] @property - def depends_text(self): + def depending_text(self): ''' Return the list of issue this issue depends on in simple text. ''' return [issue.id for issue in self.children] @property - def blocks_text(self): + def blocking_text(self): ''' Return the list of issue this issue blocks on in simple text. ''' return [issue.id for issue in self.parents] @@ -989,8 +989,8 @@ class Issue(BASE): 'user': self.user.to_json(public=public), 'private': self.private, 'tags': self.tags_text, - 'depends': [str(item) for item in self.depends_text], - 'blocks': [str(item) for item in self.blocks_text], + 'depends': [str(item) for item in self.depending_text], + 'blocks': [str(item) for item in self.blocking_text], 'assignee': self.assignee.to_json( public=public) if self.assignee else None, 'priority': self.priority, diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index 98fb0fe..bce8b27 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -223,7 +223,7 @@ {% endif%}