Skip to content

Commit

Permalink
gitmanager: lowercase compare for GH error msgs. --autopull
Browse files Browse the repository at this point in the history
This way, we don't have to worry about mistyping the upper or lowercase characters incorrectly, and we can explicitly only worry about content.  I don't trust *not* making a mistake there with case of character, so let's do the lowercase comparison instead.

Also, got annoyed about the wavy lines on DeletionWatcher's class methods, so add a suppression for those warnings and inspections in IDEs.  It was so minor a change it didn't warrant its own commit.
  • Loading branch information
teward committed Dec 28, 2016
1 parent 1bf76f3 commit 344865b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deletionwatcher.py
Expand Up @@ -9,7 +9,7 @@
import datahandling


# noinspection PyClassHasNoInit,PyBroadException
# noinspection PyClassHasNoInit,PyBroadException,PyMethodParameters
class DeletionWatcher:
@classmethod
def update_site_id_list(self):
Expand Down
2 changes: 1 addition & 1 deletion gitmanager.py
Expand Up @@ -89,7 +89,7 @@ def add_to_blacklist(**kwargs):
return (True, "You don't have code privileges, but I've [created a pull request for you]({0}).".format(response.json()["html_url"]))
except KeyError:
# Error capture/checking for any "invalid" GH reply without an 'html_url' item, which will throw a KeyError.
if "Bad credentials" in str(response.json()['message']):
if "bad credentials" in str(response.json()['message']).lower():
# Capture the case when GH credentials are bad or invalid
return (False, "Something is wrong with the GH credentials, tell someone to check them.")
else:
Expand Down

0 comments on commit 344865b

Please sign in to comment.