Skip to content

Commit c9d1eac

Browse files
committed
some fixes
1 parent e8ce4a3 commit c9d1eac

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

server/player/tenhou/management/commands/add_tenhou_account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def handle(self, *args, **options):
3737
print("Not correct account")
3838
return
3939

40-
is_main = TenhouNickname.active_objects.filter(player=player, is_active=True).count() == 0
40+
is_main = TenhouNickname.active_objects.filter(player=player).count() == 0
4141
tenhou_object = TenhouNickname.active_objects.create(
4242
is_main=is_main, player=player, tenhou_username=tenhou_nickname, username_created_at=account_start_date
4343
)

server/player/tenhou/management/commands/mark_not_active_tenhou_accounts.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Command(BaseCommand):
1717
def handle(self, *args, **options):
1818
print("{0}: Start".format(get_date_string()))
1919

20-
tenhou_objects = TenhouNickname.active_objects.filter(is_active=True)
20+
tenhou_objects = TenhouNickname.active_objects
2121
now = timezone.now().date()
2222
for tenhou_object in tenhou_objects:
2323
delta = now - tenhou_object.last_played_date
@@ -43,9 +43,7 @@ def handle(self, *args, **options):
4343
# we disabled main account for the player
4444
# maybe there is another account to be main one
4545
if tenhou_object.is_main:
46-
other_objects = TenhouNickname.active_objects.filter(
47-
player=tenhou_object.player, is_active=True
48-
).first()
46+
other_objects = TenhouNickname.active_objects.filter(player=tenhou_object.player).first()
4947

5048
if other_objects:
5149
other_objects.is_main = True

server/player/tenhou/management/commands/recalculate_tenhou_accounts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def handle(self, *args, **options):
2626
print("{0}: Start".format(get_date_string()))
2727

2828
if tenhou_nickname:
29-
tenhou_objects = TenhouNickname.active_objects.filter(is_active=True, tenhou_username=tenhou_nickname)
29+
tenhou_objects = TenhouNickname.active_objects.filter(tenhou_username=tenhou_nickname)
3030
else:
31-
tenhou_objects = TenhouNickname.active_objects.filter(is_active=True)
31+
tenhou_objects = TenhouNickname.active_objects
3232
tenhou_players_count = len(tenhou_objects)
3333
current_player_index = 1
3434
for tenhou_object in tenhou_objects:

0 commit comments

Comments
 (0)