mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
Prevent errors in previous changes.
This commit is contained in:
parent
91ceeed59a
commit
f984390244
1 changed files with 4 additions and 1 deletions
|
|
@ -61,12 +61,15 @@ class CallbackData:
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Value for '{part}' is not passed!")
|
raise ValueError(f"Value for '{part}' is not passed!")
|
||||||
|
|
||||||
|
if value is not None and not isinstance(value, str):
|
||||||
|
value = str(value)
|
||||||
|
|
||||||
if not value:
|
if not value:
|
||||||
raise ValueError(f"Value for part {part} can't be empty!'")
|
raise ValueError(f"Value for part {part} can't be empty!'")
|
||||||
elif self.sep in value:
|
elif self.sep in value:
|
||||||
raise ValueError(f"Symbol defined as separator can't be used in values of parts")
|
raise ValueError(f"Symbol defined as separator can't be used in values of parts")
|
||||||
|
|
||||||
data.append(str(value))
|
data.append(value)
|
||||||
|
|
||||||
if args or kwargs:
|
if args or kwargs:
|
||||||
raise TypeError('Too many arguments is passed!')
|
raise TypeError('Too many arguments is passed!')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue