mirror of
https://github.com/Haidra-Org/AI-Horde.git
synced 2026-11-06 05:17:31 +00:00
- 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.
16 lines
506 B
Python
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)
|