コード例 #1
0
ファイル: user.py プロジェクト: summer-of-open-source/OTM2
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)
コード例 #2
0
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)
コード例 #3
0
ファイル: views.py プロジェクト: mmcfarland/OTM2
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)