Fix bug in middleware when domain config is None (#567)

This commit is contained in:
Karthik Balakrishnan 2023-05-04 23:29:11 +05:30 committed by GitHub
parent 7862795993
commit dbc25f538d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ from core.models import Config
def homepage(request):
if request.user.is_authenticated:
return Home.as_view()(request)
elif request.domain.config_domain.single_user:
elif request.domain and request.domain.config_domain.single_user:
return redirect(f"/@{request.domain.config_domain.single_user}/")
else:
return About.as_view()(request)