From 8d4d1a21cd30ad612b64659c83f6fef856530459 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sat, 26 Apr 2014 04:23:00 -0700 Subject: [PATCH] Fix for no status attribute error --- sickbeard/providers/newznab.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index 6102df84..e55d31dc 100644 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -166,21 +166,21 @@ class NewznabProvider(generic.NZBProvider): if data is None: return self._checkAuth() - status = data.status - if status: - if status in [200, 301]: + if 'status' in data: + if data.status in [200, 301]: return True - if status == 100: + if data.status == 100: raise AuthException("Your API key for " + self.name + " is incorrect, check your config.") - elif status == 101: + elif data.status == 101: raise AuthException("Your account on " + self.name + " has been suspended, contact the administrator.") - elif status == 102: + elif data.status == 102: raise AuthException( "Your account isn't allowed to use the API on " + self.name + ", contact the administrator") else: logger.log(u"Unknown error given from " + self.name + ": " + data.feed.title, logger.ERROR) - return False + return False + return True def _doSearch(self, search_params, show=None, max_age=0):