mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-26 17:21:00 +00:00
22 lines
480 B
Python
22 lines
480 B
Python
|
from django.views.generic import TemplateView
|
||
|
|
||
|
from statuses.views.home import Home
|
||
|
from users.models import Identity
|
||
|
|
||
|
|
||
|
def homepage(request):
|
||
|
if request.user.is_authenticated:
|
||
|
return Home.as_view()(request)
|
||
|
else:
|
||
|
return LoggedOutHomepage.as_view()(request)
|
||
|
|
||
|
|
||
|
class LoggedOutHomepage(TemplateView):
|
||
|
|
||
|
template_name = "index.html"
|
||
|
|
||
|
def get_context_data(self):
|
||
|
return {
|
||
|
"identities": Identity.objects.filter(local=True),
|
||
|
}
|