mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-10 09:18:33 +01:00
Only show the created avatar attachment type for user attachments
This commit is contained in:
@@ -52,7 +52,7 @@ class AttachmentTypeAdminForm extends BaseEntityAdminForm
|
||||
if (!is_a($class, Attachment::class, true)) {
|
||||
return $class;
|
||||
}
|
||||
return new StaticMessage($this->elementTypeNameGenerator->typeLabel($class::ALLOWED_ELEMENT_CLASS));
|
||||
return new StaticMessage($this->elementTypeNameGenerator->typeLabelPlural($class::ALLOWED_ELEMENT_CLASS));
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@ class UserAvatarHelper
|
||||
$attachment_type = new AttachmentType();
|
||||
$attachment_type->setName('Avatars');
|
||||
$attachment_type->setFiletypeFilter('image/*');
|
||||
$attachment_type->setAllowedTargets([UserAttachment::class]);
|
||||
$this->entityManager->persist($attachment_type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user