2015-10-05 16:35:30 +00:00
|
|
|
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
|
|
|
|
2015-10-05 16:35:30 +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)
|