Skip to content

Commit

Permalink
Merge pull request #245 from phenobarbital/dev
Browse files Browse the repository at this point in the history
forcing use _del_primary_data on DELETE method for ModelView
  • Loading branch information
phenobarbital authored Apr 3, 2024
2 parents ec8eb40 + 75c17ac commit 58c9151
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion navigator/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__description__ = (
"Navigator Web Framework based on aiohttp, " "with batteries included."
)
__version__ = "2.8.37"
__version__ = "2.8.38"
__author__ = "Jesus Lara"
__author_email__ = "jesuslarag@gmail.com"
__license__ = "BSD"
7 changes: 6 additions & 1 deletion navigator/views/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,12 @@ async def delete(self):
if hasattr(self, '_del_primary_data'):
objid = await self._del_primary_data(args)
else:
objid = await self._get_primary_data(args)
return self.error(
response={
"message": "A _del_primary_data method is required for filtering DELETE data."
},
status=422
)
if objid:
async with await self.handler(request=self.request) as conn:
self.model.Meta.connection = conn
Expand Down

0 comments on commit 58c9151

Please sign in to comment.