Use new ValidTheme constraint on theme field.

The old choice constraint needed an const, which is not available anymore, as you can configure the themes via parameters
This commit is contained in:
Jan Böhmer 2023-02-01 23:50:54 +01:00
parent f1c3a52c8a
commit 3c3a03a179
4 changed files with 92 additions and 1 deletions

View file

@ -29,6 +29,7 @@ use App\Entity\PriceInformations\Currency;
use App\Security\Interfaces\HasPermissionsInterface;
use App\Validator\Constraints\Selectable;
use App\Validator\Constraints\ValidPermission;
use App\Validator\Constraints\ValidTheme;
use Jbtronics\TFAWebauthn\Model\LegacyU2FKeyInterface;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Webauthn\PublicKeyCredentialUserEntity;
@ -77,7 +78,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* @var string|null The theme
* @ORM\Column(type="string", name="config_theme", nullable=true)
* @Assert\Choice(choices=User::AVAILABLE_THEMES)
* @ValidTheme()
*/
protected ?string $theme = null;