Browse Source

Added True return and info logger to refund_points

deadtom 1 month ago
parent
commit
e58845ab91
1 changed files with 3 additions and 1 deletions
  1. 3 1
      ownchatbot/user_handlers.py

+ 3 - 1
ownchatbot/user_handlers.py

@@ -136,6 +136,7 @@ def adjust_points(db, user_id, points):  # For streamer to manually adjust a use
             (points, user_id,)
         )
         db.commit()
+        current_app.logger.info(f'Adjusted points for {user_id}')
         return True
     except Error as aperror:
         current_app.logger.error(f'Couldn\'t adjust points for {user_id}: {aperror.args[0]}')
@@ -200,8 +201,9 @@ def refund_points(db, user_id, points):  # Streamer refunds points for a redeem
             (points, user_id,)
         )
         db.commit()
+        current_app.logger.info(f'Refunded {points} points to {user_id}.')
         return True
-    except Error as rerror:
+    except Exception as rerror:
         current_app.logger.error(f'Couldn\'t refund {points} points for {user_id}: {rerror.args[0]}')
         return False