mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Handle case of failing literal_eval in admin view. Resolves #1988
This commit is contained in:
parent
b7a7f45ba7
commit
f124b3510b
1 changed files with 3 additions and 2 deletions
|
|
@ -133,8 +133,9 @@ class PickledWidget(Textarea):
|
|||
try:
|
||||
# necessary to convert it back after repr(), otherwise validation errors will mutate it
|
||||
value = literal_eval(repr_value)
|
||||
except ValueError:
|
||||
pass
|
||||
except (ValueError, SyntaxError):
|
||||
# we could not eval it, just show its prepresentation
|
||||
value = repr_value
|
||||
return super().render(name, value, attrs=attrs, renderer=renderer)
|
||||
|
||||
def value_from_datadict(self, data, files, name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue