This code checks if the user making the request is...

April 23, 2024 at 05:57 AM

if (request.user.is_staff or request.user.is_superuser): raise exceptions.SuspiciousOperation("User {} can't download reports of company {}" "".format(request.user, company_id)

This code checks if the user making the request is a staff member or a superuser. If the user is not a staff member or a superuser, it raises a SuspiciousOperation exception with a message indicating that the user is not authorized to download reports for a specific company.

Generate your own explanations
Download our vscode extension
Read other generated explanations

Built by @thebuilderjr
Sponsored by beam analytics
Read our terms and privacy policy
Forked from openai-quickstart-node