Skip to content

Commit

Permalink
post_scorecounter error
Browse files Browse the repository at this point in the history
  • Loading branch information
yahvk-cuna committed Jan 16, 2022
1 parent d22733f commit 98e4ba3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion AnkiHabitica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ def check_unsynced_score():
'''):
if ah.user_settings["keep_log"]:
ah.log.debug('Syncing backlog')
score_backlog(True)
score_backlog()


if new_hook:
Expand Down
30 changes: 16 additions & 14 deletions AnkiHabitica/habitica_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,20 +421,22 @@ def grab_scorecounter(self):
def post_scorecounter(self):
if ah.user_settings["keep_log"]:
ah.log.debug("Begin function")
try:
habitID = self.habit_id
if ah.user_settings["keep_log"]:
ah.log.debug("posting scorecounter: %s" % self.hnote)
datastring = json.dumps(self.hnote)
data = {"notes": datastring}
self.api.update_task(habitID, data)
if ah.user_settings["keep_log"]:
ah.log.debug("End function returning: %s" % True)
return True
except:
if ah.user_settings["keep_log"]:
ah.log.error("End function returning: %s" % False)
return False
# try:
habitID = self.habit_id
if ah.user_settings["keep_log"]:
ah.log.debug("posting scorecounter: %s" % self.hnote)
datastring = json.dumps(self.hnote)
data = {"notes": datastring}
self.api.update_task(habitID, data)
if ah.user_settings["keep_log"]:
ah.log.debug("End function returning: %s" % True)
return True
# except:
# if ah.user_settings["debug"]:
# raise
# if ah.user_settings["keep_log"]:
# ah.log.error("End function returning: %s" % False)
# return False

def test_internet(self):
if ah.user_settings["keep_log"]:
Expand Down

0 comments on commit 98e4ba3

Please sign in to comment.