Coverage for src/lexigram/admin/settings/panel/branding_spec.py: 100%

16 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-21 14:56 +0800

1"""Branding and theme configuration specification.""" 

2 

3from __future__ import annotations 

4 

5from lexigram.admin.settings.panel.models import BrandingSettings 

6from lexigram.admin.settings.panel.nodes import ColorNode, PydanticConfigSpec 

7from lexigram.admin.settings.panel.registry import ConfigRegistry 

8 

9__all__ = ["BrandingSpec", "register_spec"] 

10 

11 

12class BrandingSpec(PydanticConfigSpec): 

13 """Branding and theme settings spec.""" 

14 

15 namespace = "admin.branding" 

16 label = "Branding & Theme" 

17 icon = "palette" 

18 description = "Site name, colors, logo, and theme preference." 

19 model = BrandingSettings 

20 node_overrides = {"primary_color": ColorNode} 

21 required_permissions = frozenset({"admin.settings.edit"}) 

22 scope = "tenant" 

23 

24 

25def register_spec(registry: ConfigRegistry) -> None: 

26 """Register this spec with the config registry.""" 

27 registry.register_spec(BrandingSpec)