code cleanup

This commit is contained in:
Jonas Winkler
2020-11-21 15:34:00 +01:00
parent afc3753e58
commit a532200d10
6 changed files with 71 additions and 49 deletions

View File

@@ -9,7 +9,7 @@ class AngularApiAuthenticationOverride(authentication.BaseAuthentication):
"""
def authenticate(self, request):
if settings.DEBUG and 'Referer' in request.headers and request.headers['Referer'].startswith('http://localhost:4200/'):
if settings.DEBUG and 'Referer' in request.headers and request.headers['Referer'].startswith('http://localhost:4200/'): # NOQA: E501
user = User.objects.filter(is_staff=True).first()
print("Auto-Login with user {}".format(user))
return (user, None)