|
43 | 43 | from . import ProtectedResource
|
44 | 44 | from .emit import GrampsJSONEncoder
|
45 | 45 | from .filters import apply_filter
|
| 46 | +from ...const import NAME_FORMAT_REGEXP |
46 | 47 | from .util import (
|
47 | 48 | get_person_profile_for_object,
|
48 | 49 | get_place_profile_for_object,
|
@@ -540,7 +541,7 @@ class PersonTimelineResource(ProtectedResource, GrampsJSONEncoder):
|
540 | 541 | "keys": fields.DelimitedList(fields.Str(validate=validate.Length(min=1))),
|
541 | 542 | "last": fields.Boolean(load_default=True),
|
542 | 543 | "locale": fields.Str(load_default=None),
|
543 |
| - "name_format": fields.Str(validate=validate.Length(min=1)), |
| 544 | + "name_format": fields.Str(validate=validate.Regexp(NAME_FORMAT_REGEXP)), |
544 | 545 | "offspring": fields.Integer(
|
545 | 546 | load_default=1, validate=validate.Range(min=1, max=5)
|
546 | 547 | ),
|
@@ -633,7 +634,7 @@ class FamilyTimelineResource(ProtectedResource, GrampsJSONEncoder):
|
633 | 634 | "events": fields.DelimitedList(fields.Str(validate=validate.Length(min=1))),
|
634 | 635 | "keys": fields.DelimitedList(fields.Str(validate=validate.Length(min=1))),
|
635 | 636 | "locale": fields.Str(load_default=None),
|
636 |
| - "name_format": fields.Str(validate=validate.Length(min=1)), |
| 637 | + "name_format": fields.Str(validate=validate.Regexp(NAME_FORMAT_REGEXP)), |
637 | 638 | "page": fields.Integer(load_default=0, validate=validate.Range(min=1)),
|
638 | 639 | "pagesize": fields.Integer(load_default=20, validate=validate.Range(min=1)),
|
639 | 640 | "ratings": fields.Boolean(load_default=False),
|
|
0 commit comments