mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix for MagicParameters error with no POST body, closes #967
This commit is contained in:
parent
65ca17d729
commit
448d13ea6b
2 changed files with 41 additions and 1 deletions
|
|
@ -371,6 +371,11 @@ class MagicParameters(dict):
|
|||
)
|
||||
)
|
||||
|
||||
def __len__(self):
|
||||
# Workaround for 'Incorrect number of bindings' error
|
||||
# https://github.com/simonw/datasette/issues/967#issuecomment-692951144
|
||||
return super().__len__() or 1
|
||||
|
||||
def __getitem__(self, key):
|
||||
if key.startswith("_") and key.count("_") >= 2:
|
||||
prefix, suffix = key[1:].split("_", 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue