Skip to content

Instantly share code, notes, and snippets.

@lig
Created August 24, 2012 08:16
Show Gist options
  • Save lig/3447412 to your computer and use it in GitHub Desktop.
Save lig/3447412 to your computer and use it in GitHub Desktop.
def another_profile(request, id):
user2 = CustomUser.objects.get(id = id)
if request.user.is_authenticated():
if request.user == user2:
viewable = False
else:
viewable = True
userlist = request.user.friends.all()
try:
Friendship.objects.get(user=request.user)
friend = True
except ValueError:
friend = False
form = CustomUser.objects.get(id = id)
return render(request, "another_profile.html", locals())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment