From da51f5f8ee0617434131ab6526f84b0da4879095 Mon Sep 17 00:00:00 2001 From: Deekshan Saravanan Date: Mon, 16 Oct 2023 10:43:35 -0700 Subject: [PATCH] Bug fix --- README.adoc | 10 +++++----- controllers/torn/__init__.py | 1 + controllers/torn/users.py | 1 + skynet/commands/notify/items.py | 15 +++------------ 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/README.adoc b/README.adoc index a8935290..485e1199 100644 --- a/README.adoc +++ b/README.adoc @@ -1,12 +1,13 @@ = Tornium -A third party, general-purpose website and Discord bot dedicated to simplifying the playing of https://www.torn.com[Torn City]. +A third party, general-purpose website and Discord bot dedicated to simplifying the playing of https://www.torn.com[Torn City] built from scratch with love <3. Tornium is split into three main repositories: - https://www.github.com/Tornium/tornium-core[tornium-core] - Flask app for frontend and Discord bot - https://www.github.com/Tornium/tornium-celery[tornium-celery] - Celery app containing Celery tasks and configuration - https://www.github.com/Tornium/tornium-commons[tornium-commons] - common utility functions and classes for Tornium + - Plus several features built on Tornium extensions == Features - Faction banking @@ -20,7 +21,6 @@ Tornium is split into three main repositories: - Chain list generator == Deprecation Notice -IMPORTANT: Pre-existing stakeouts will be removed in the v0.4.x release cycle. Pre-existing stakeouts will not be migrated. IMPORTANT: Assist request forwarding options will be removed in the v0.5.x release cycle. == Installation @@ -38,7 +38,7 @@ Tornium partially supports extensions for new Discord commands and new Flask end NOTE: Tornium extensions must be released as open source code under a GPLv3 or another GPL license due to the restrictions of the https://github.com/dssecret/tornium-pro/blob/master/LICENSE[tornium-pro license]. For more details, take a look at https://www.gnu.org/licenses/gpl-3.0.en.html[GPL website]. == License -https://github.com/dssecret/tornium-pro/blob/master/LICENSE[AGPLv3] +Tornium repositories are licensed under https://github.com/dssecret/tornium-pro/blob/master/LICENSE[AGPLv3]. For information about how the AGPL license affects you, please take a look at the [GNU website]. == Release Notes This project follows https://semver.org/[semver v2.0] so all bug fixes, breaking changes, features, etc. can be found in the https://github.com/dssecret/tornium-pro/blob/master/CHANGELOG.adoc[changelog]. @@ -55,5 +55,5 @@ server costs (and other hosting costs). Donate https://www.buymeacoffee.com/tornium[here]! == Contact - - tiksan on Discord at tiksan(hastag)9110 - - tiksan on Torn at https://www.torn.com/profiles.php?XID=2383326[tiksan [2383326\]] \ No newline at end of file + - tiksan on Discord at @tiksan + - tiksan on Torn at https://www.torn.com/profiles.php?XID=2383326[tiksan [2383326\]] diff --git a/controllers/torn/__init__.py b/controllers/torn/__init__.py index 084cb1c1..cff4d3fc 100644 --- a/controllers/torn/__init__.py +++ b/controllers/torn/__init__.py @@ -37,6 +37,7 @@ # Users Routes mod.add_url_rule("/torn/user/", view_func=users.user_data, methods=["GET"]) mod.add_url_rule("/torn/users", view_func=users.users, methods=["GET"]) +mod.add_url_rule("/torn/usersdata", view_func=users.users_data, methods=["GET"]) @mod.route("/torn") diff --git a/controllers/torn/users.py b/controllers/torn/users.py index e28f9346..c53f7116 100644 --- a/controllers/torn/users.py +++ b/controllers/torn/users.py @@ -114,6 +114,7 @@ def users_data(): return data + @login_required def user_data(tid: int): if tid == 0 or current_user.key == "": diff --git a/skynet/commands/notify/items.py b/skynet/commands/notify/items.py index 3c7a2df4..8c46e865 100644 --- a/skynet/commands/notify/items.py +++ b/skynet/commands/notify/items.py @@ -129,12 +129,7 @@ def item_notif_init(interaction, user: UserModel, item: ItemModel, subcommand_da } if private: - if ( - NotificationModel.objects( - Q(ntype=3) & Q(recipient_guild=0) & Q(invoker=user.tid) - ).count() - > 10 - ): + if NotificationModel.objects(Q(ntype=3) & Q(recipient_guild=0) & Q(invoker=user.tid)).count() > 10: return { "type": 4, "data": { @@ -263,9 +258,7 @@ def list_item_notifs(interaction, user: UserModel, *args, **kwargs): & (Q(recipient_guild=int(interaction["guild_id"])) | (Q(recipient_guild=0) & Q(invoker=user.tid))) ) else: - notifications = NotificationModel.objects( - Q(ntype=3) & Q(recipient_guild=0) & Q(invoker=user.tid) - ) + notifications = NotificationModel.objects(Q(ntype=3) & Q(recipient_guild=0) & Q(invoker=user.tid)) if notifications.count() == 0: return { @@ -610,9 +603,7 @@ def items_button_switchboard(interaction, *args, **kwargs): & (Q(recipient_guild=int(interaction["guild_id"])) | (Q(recipient_guild=0) & Q(invoker=user.tid))) ) else: - notifications = NotificationModel.objects( - Q(ntype=3) & Q(recipient_guild=0) & Q(invoker=user.tid) - ) + notifications = NotificationModel.objects(Q(ntype=3) & Q(recipient_guild=0) & Q(invoker=user.tid)) notification_count = notifications.count()