Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add UidBone #1131

Merged
merged 20 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change readOnly check
ArneGudermann committed Oct 16, 2024
commit fc0953cfe917e2e14ee0c1a1bf41e98dbb714368
4 changes: 1 addition & 3 deletions src/viur/core/bones/uid.py
Original file line number Diff line number Diff line change
@@ -55,7 +55,6 @@ def __init__(
fillchar: str = "*",
length: int = 13,
pattern: str | t.Callable | None = "*",
readOnly: bool = False,
**kwargs
):
"""
@@ -71,13 +70,12 @@ def __init__(
super().__init__(
compute=Compute(fn=generate_fn, interval=ComputeInterval(ComputeMethod.Once)),
unique=UniqueValue(UniqueLockMethod.SameValue, False, "Unique Value already in use"),
readOnly=readOnly,
**kwargs
)
if self.multiple or self.languages:
raise ValueError("UidBone cannot be multiple or translated")

if self.readOnly:
if not self.readOnly:
raise ValueError("UidBone must be read-only")

self.fillchar = str(fillchar)