Fix: Try to migrate middlware to new version

This commit is contained in:
winkidney
2020-07-17 13:42:35 +08:00
parent 7398bc11f8
commit 7608ef928a
4 changed files with 11 additions and 4 deletions

View File

@@ -2,12 +2,15 @@ from django.conf import settings
from django.http import HttpResponseForbidden
class Public(object):
class Public:
acceptable_paths = (
"/api/v2/profile/",
)
def __init__(self, get_response):
self.get_response = get_response
def process_request(self, request):
if settings.PUBLIC is False and not request.user.is_authenticated():
for path in self.acceptable_paths: