tweak log format
This commit is contained in:
parent
362ab9cd65
commit
819e8ffda4
5 changed files with 4 additions and 34 deletions
|
@ -241,7 +241,7 @@ class Content(Piece):
|
|||
remote_id = models.CharField(max_length=200, null=True, default=None)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.uuid}@{self.item}"
|
||||
return f"{self.__class__.__name__}:{self.uuid}@{self.item}"
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
|
|
@ -164,4 +164,4 @@ class ListMember(Piece):
|
|||
abstract = True
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.id}:{self.position} ({self.item})"
|
||||
return f"{self.__class__.__name__}:{self.id}@{self.position}:{self.item}"
|
||||
|
|
|
@ -193,7 +193,7 @@ class ShelfLogEntry(models.Model):
|
|||
]
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.owner}:{self.shelf_type}:{self.item.uuid}:{self.timestamp}"
|
||||
return f"LOG:{self.owner}:{self.shelf_type}:{self.item.uuid}:{self.timestamp}"
|
||||
|
||||
@property
|
||||
def action_label(self):
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
from loguru import logger
|
||||
from tqdm import tqdm
|
||||
|
||||
from takahe.utils import Takahe
|
||||
from users.models import APIdentity, User
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Manage import tasks"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
"--reset",
|
||||
action="store_true",
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
count = 0
|
||||
for identity in tqdm(APIdentity.objects.filter(local=True)):
|
||||
if (
|
||||
identity.is_active
|
||||
and not identity.takahe_identity.profile_uri.startswith("http")
|
||||
):
|
||||
identity.takahe_identity.profile_uri = identity.user.absolute_url
|
||||
identity.takahe_identity.save(update_fields=["profile_uri"])
|
||||
Takahe.update_state(identity.takahe_identity, "edited")
|
||||
count += 1
|
||||
self.stdout.write(self.style.SUCCESS(f"{count} user(s) fixed"))
|
|
@ -207,7 +207,7 @@ class User(AbstractUser):
|
|||
return settings.SITE_INFO["site_url"] + self.url
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.pk}:{self.username or ""}:{self.mastodon_acct}'
|
||||
return f'USER:{self.pk}:{self.username or "<missing>"}:{self.mastodon_acct or self.email}'
|
||||
|
||||
@property
|
||||
def registration_complete(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue