fix card badges to have better rarity visibility and other bugfixes
This commit is contained in:
parent
37d8bd5981
commit
262f0ea190
14 changed files with 4515 additions and 1255 deletions
|
|
@ -1,19 +0,0 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
from accounts.models import CustomUser, FriendCode
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Seed default friend codes for TestUsers after friend codes have been loaded."
|
||||
|
||||
def handle(self, *args, **options):
|
||||
users_updated = 0
|
||||
for user in CustomUser.objects.all():
|
||||
# Automatically select the earliest friend code added for the user:
|
||||
default_code = FriendCode.objects.filter(user=user).order_by('created_at').first()
|
||||
if default_code:
|
||||
user.default_friend_code = default_code
|
||||
user.save(update_fields=["default_friend_code"])
|
||||
self.stdout.write(f"Set default friend code for user {user.username} to {default_code.friend_code}.")
|
||||
users_updated += 1
|
||||
else:
|
||||
self.stdout.write(f"No friend code found for user {user.username}.")
|
||||
self.stdout.write(self.style.SUCCESS(f"Seeded default friend codes for {users_updated} user(s)."))
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 5.1.2 on 2025-03-31 22:48
|
||||
# Generated by Django 5.1.2 on 2025-04-07 04:19
|
||||
|
||||
import accounts.models
|
||||
import django.contrib.auth.models
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue