Re: Error in function to return permissions

2018-11-01 Thread Joel Mathew
Thank you! Sincerely yours, Joel G Mathew On Wed, 31 Oct 2018 at 21:36, Stephen J. Butler wrote: > > @login_required needs "request" as the first parameter. > > On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew wrote: >> >> I have a custom function to check if a user is authorized to do >>

Re: Error in function to return permissions

2018-10-31 Thread Stephen J. Butler
@login_required needs "request" as the first parameter. On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew wrote: > I have a custom function to check if a user is authorized to do > certain functions: > > @login_required > def checkpermission(request, permiss): > username = request.user.username

Error in function to return permissions

2018-10-31 Thread Joel Mathew
I have a custom function to check if a user is authorized to do certain functions: @login_required def checkpermission(request, permiss): username = request.user.username print(f"username is {username}") print(f"User.objects.filter() is {User.objects.filter()}") userobj =