Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dssecret committed Nov 15, 2023
1 parent 3cf5b77 commit 3802ac1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
8 changes: 0 additions & 8 deletions controllers/api/faction/assist.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,6 @@ def forward_assist(*args, **kwargs):
},
)

stat: StatModel = (
StatModel.objects(
Q(tid=target_tid) & (Q(globalstat=True) | Q(addedfactiontid=user.factionid) | Q(addedid=user_tid))
)
.order_by("-timeadded")
.first()
)

stat: typing.Optional[Stat]
try:
stat = Stat.get(
Expand Down
2 changes: 1 addition & 1 deletion controllers/api/stocks/movers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
def get_closest_tick(stock_id: int, start_timestamp: int):
for n in range(1, 30):
tick_id = int(bin(stock_id), 2) + int(bin((start_timestamp + n * 60) << 8), 2)
tick: typing.Optional[TickModel] = TickModel.objects(tick_id=tick_id).first()
tick: typing.Optional[StockTick] = StockTick.objects(tick_id=tick_id).first()

if tick is not None:
return tick
Expand Down
25 changes: 0 additions & 25 deletions skynet/commands/faction/fulfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,6 @@
from skynet.skyutils import get_admin_keys


def fulfiller_string(withdrawal: WithdrawalModel) -> str:
if withdrawal.fulfiller == 0:
return "is not fulfilled"
elif withdrawal.fulfiller == -1:
return "has been cancelled by the system"
elif withdrawal.fulfiller < -1:
user: typing.Optional[UserModel] = UserModel.objects(tid=-withdrawal.fulfiller).only("name", "tid").first()

if user is None:
return "has been cancelled by someone"

return f"has been cancelled by {user.name} [{user.tid}]"
elif withdrawal.fulfiller == 1:
return "has been fulfilled by someone"
elif withdrawal.fulfiller > 1:
user: typing.Optional[UserModel] = UserModel.objects(tid=withdrawal.fulfiller).only("name", "tid").first()

if user is None:
return "has been fulfilled by someone"

return f"has been fulfilled by {user.name} [{user.tid}]"

return "has an unknown fulfill type"


def fulfill_command(interaction, *args, **kwargs):
if "guild_id" not in interaction:
return {
Expand Down

0 comments on commit 3802ac1

Please sign in to comment.