'PATCH /api/user/v1/accounts/{username}/
Note that this implementation is the "merge patch" implementation proposed in
https://tools.ietf.org/html/rfc7396. The content_type must be "application/merge-patch+json" or
else an error response with status code 415 will be returned.'

def partial_update(self, request, username):

    try:
        with transaction.atomic():
            update_account_settings(request.user, request.data, username=username)
            account_settings = get_account_settings(request, [username])[0]
    except UserNotAuthorized:
        return Response(status=(status.HTTP_403_FORBIDDEN if request.user.is_staff else status.HTTP_404_NOT_FOUND))
    except UserNotFound:
        return Response(status=status.HTTP_404_NOT_FOUND)
    except AccountValidationError as err:
        return Response({'field_errors': err.field_errors}, status=status.HTTP_400_BAD_REQUEST)
    except AccountUpdateError as err:
        return Response({'developer_message': err.developer_message, 'user_message': err.user_message}, status=status.HTTP_400_BAD_REQUEST)
    return Response(account_settings)
