bornhack-website/profiles/views.py

17 lines
477 B
Python
Raw Normal View History

from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic import DetailView
2015-10-03 01:07:05 +00:00
from .models import Profile
class ProfileDetail(DetailView):
model = Profile
@method_decorator(login_required)
def get(self, request, *args, **kwargs):
return super().get(request, *args, **kwargs)
def get_object(self, queryset=None):
return Profile.objects.get(user=self.request.user)