Skip to content

Commit

Permalink
Merge pull request #190 from phenobarbital/dev
Browse files Browse the repository at this point in the history
service_auth is a staticmethod
  • Loading branch information
phenobarbital authored Oct 19, 2023
2 parents e07798f + dfe29b6 commit 2c6bf95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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.6.39"
__version__ = "2.6.40"
__author__ = "Jesus Lara"
__author_email__ = "jesuslarag@gmail.com"
__license__ = "BSD"
5 changes: 3 additions & 2 deletions navigator/views/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ async def get_userid(self, session, idx: str = 'user_id') -> int:
status=403
)

@staticmethod
def service_auth(fn: Union[Any, Any]) -> Any:
async def _wrap(self, *args, **kwargs):
## get User Session:
Expand Down Expand Up @@ -521,8 +522,8 @@ async def _get_data(self, qp, args):
async def _get_filters():
value = {}
for name, column in self.model.get_columns().items():
### if a function with name _get_{column name} exists
### then that function is called for getting the field value
### if a function with name _filter_{column name} exists
### then that function is called for filtering the field value
fn = getattr(self, f'_filter_{name}', None)
if fn:
try:
Expand Down

0 comments on commit 2c6bf95

Please sign in to comment.