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 SpamBone #1209

Merged
merged 6 commits into from
Jul 15, 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
Improved precision parameter handling
Co-authored-by: Sven Eberth <mail@sveneberth.de>
  • Loading branch information
phorward and sveneberth authored Jul 11, 2024
commit 4d8d9e60f25bb6411331915560f63c66736e8f5b
5 changes: 2 additions & 3 deletions src/viur/core/bones/spam.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ def __init__(
for digit in ("one", "two", "three", "four", "five", "six", "seven", "eight", "nine")
),
required: bool = True,
precision: int = 0,
msg_invalid: str = i18n.translate(
"core.bones.spam.invalid",
"Your answer was wrong! Please try again."
),
**kwargs
):
if precision != 0:
if "precision" in kwargs:
raise ValueError(f"Cannot use {self.__class__.__name__!r} with a precision")

super().__init__(
required=required,
precision=precision,
precision=0,
**kwargs
)

Expand Down
Loading