Skip to content

Commit

Permalink
clean up some comments (#1625)
Browse files Browse the repository at this point in the history
* clean up some comments

* chore: join nested ifs

* fix: fix for #1587 broken badge
  • Loading branch information
studioj committed May 17, 2023
1 parent 916fced commit a69da77
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ Jira Python Library
.. image:: https://img.shields.io/bountysource/team/pycontribs/activity.svg
:target: https://www.bountysource.com/teams/pycontribs/issues?tracker_ids=3650997

.. image:: https://requires.io/github/pycontribs/jira/requirements.svg?branch=main
:target: https://requires.io/github/pycontribs/jira/requirements/?branch=main
:alt: Requirements Status


This library eases the use of the Jira REST API from Python and it has been used in production for years.

Expand Down
2 changes: 1 addition & 1 deletion examples/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This script will cleanup your jira instance by removing all projects and
# it is used to clean the CI/CD Jira server used for testing.
#

from __future__ import annotations

import json
Expand Down
32 changes: 18 additions & 14 deletions jira/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,22 +326,26 @@ def update(
user = None
error_list = parse_errors(r)
logging.error(error_list)
if "The reporter specified is not a user." in error_list:
if "reporter" not in data["fields"]:
logging.warning(
"autofix: setting reporter to '%s' and retrying the update."
% self._options["autofix"]
)
data["fields"]["reporter"] = {"name": self._options["autofix"]}
if (
"The reporter specified is not a user." in error_list
and "reporter" not in data["fields"]
):
logging.warning(
"autofix: setting reporter to '%s' and retrying the update."
% self._options["autofix"]
)
data["fields"]["reporter"] = {"name": self._options["autofix"]}

if "Issues must be assigned." in error_list:
if "assignee" not in data["fields"]:
logging.warning(
"autofix: setting assignee to '{}' for {} and retrying the update.".format(self._options["autofix"], self.key)
if (
"Issues must be assigned." in error_list
and "assignee" not in data["fields"]
):
logging.warning(
"autofix: setting assignee to '{}' for {} and retrying the update.".format(
self._options["autofix"], self.key
)
data["fields"]["assignee"] = {"name": self._options["autofix"]}
# for some reason the above approach fails on Jira 5.2.11, so
# we need to change the assignee before
)
data["fields"]["assignee"] = {"name": self._options["autofix"]}

if (
"Issue type is a sub-task but parent issue key or id not specified."
Expand Down

0 comments on commit a69da77

Please sign in to comment.