1
0
Fork 0

Merge pull request #288 from xeroticikot/model-admin-fix

fixed the "attachements" string
This commit is contained in:
Pietro 2024-04-16 19:11:26 +02:00 committed by GitHub
commit 7701701a88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,7 +62,7 @@ class MessageAttachmentInline(admin.TabularInline):
class MessageAdmin(admin.ModelAdmin): class MessageAdmin(admin.ModelAdmin):
def get_queryset(self, *args, **kwargs): def get_queryset(self, *args, **kwargs):
return super().get_queryset(*args, **kwargs).annotate(num_attachments=Count('attachements')) return super().get_queryset(*args, **kwargs).annotate(num_attachments=Count('attachments'))
def attachment_count(self, msg): def attachment_count(self, msg):
return msg.num_attachments return msg.num_attachments