def get_context_data(self, **kwargs):
    context = super(ProfileDetailView, self).get_context_data(**kwargs)
    user = self.request.user
    profile = Profile.objects.get(user=self.request.user)
    new_messages_count = profile.get_new_messages_count()
    view_profile = Profile.objects.get(id=self.kwargs['pk'])
    are_friends = profile.are_friends(view_profile)
    waiting = profile.waiting_friendship_approval(view_profile)
    if waiting:
        if (profile == waiting):
            context['waiting'] = 'WAITING APPROVAL'
        else:
            context['waiting'] = 'ACCEPT REQUEST'
    context['profile'] = profile
    context['are_friends'] = are_friends
    context['new_messages_count'] = new_messages_count
    context['site_name'] = "What's the Craic?"
    context['title'] = '- Add User'
    context['submit_btn'] = 'Create Account'
    return context
def get_context_data(self, **kwargs):
    context = super(ProfileDetailView, self).get_context_data(**kwargs)
    user = self.request.user
    profile = Profile.objects.get(user=self.request.user)
    new_messages_count = profile.get_new_messages_count()
    view_profile = Profile.objects.get(id=self.kwargs['pk'])
    are_friends = profile.are_friends(view_profile)
    waiting = profile.waiting_friendship_approval(view_profile)
    if waiting:
        if (profile == waiting):
            context['waiting'] = 'WAITING APPROVAL'
        else:
            context['waiting'] = 'ACCEPT REQUEST'
    context['profile'] = profile
    context['are_friends'] = are_friends
    context['new_messages_count'] = new_messages_count
    context['site_name'] = "What's the Craic?"
    context['title'] = '- Add User'
    context['submit_btn'] = 'Create Account'
    return context