Files
tazlin fc5a05170f refactor: main namespace importable; integration and unit tests
- Reworks many import-time behaviors to their own functions. This is to facilitate making the AI-Horde 'package' importable without side-effects - this makes unit testing possible.
- Moves existing integration tests to 	ests/integration
- Create unit tests for constants, exceptions, imports, and utility functions.
2026-07-05 13:36:59 -04:00

16 lines
506 B
Python

# SPDX-FileCopyrightText: 2022 Konstantinos Thoukydidis <mail@dbzer0.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
from loguru import logger
from horde.database import functions as database
from horde.flask import get_app
@logger.catch(reraise=True)
def force_subscription_kudos(user_id, prevent_date_change):
with get_app().app_context():
user = database.find_user_by_id(user_id)
user.receive_monthly_kudos(force=True, prevent_date_change=prevent_date_change)