def update_profile_photo(request, user_id): user = get_object_or_404(User, pk=user_id) if user.pk != request.user.pk: return HttpResponseForbidden() return upload_user_photo(request, user)
def add_profile_photo(request, user_id, _): """ Uploads a user profile photo. The third parameter to this function exists for backwards compatibility reasons, but is ignored and unused. """ user = get_object_or_404(User, id=user_id) if user != request.user: return HttpResponseForbidden() return upload_user_photo(request, user_id)