Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dssecret committed Oct 16, 2023
1 parent 859e3ed commit da51f5f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
10 changes: 5 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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].
Expand All @@ -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\]]
- tiksan on Discord at @tiksan
- tiksan on Torn at https://www.torn.com/profiles.php?XID=2383326[tiksan [2383326\]]
1 change: 1 addition & 0 deletions controllers/torn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# Users Routes
mod.add_url_rule("/torn/user/<int:tid>", 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")
Expand Down
1 change: 1 addition & 0 deletions controllers/torn/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def users_data():

return data


@login_required
def user_data(tid: int):
if tid == 0 or current_user.key == "":
Expand Down
15 changes: 3 additions & 12 deletions skynet/commands/notify/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit da51f5f

Please sign in to comment.