human
Solve the following python programming problem given the following code:
def add_url_rule(self, rule, endpoint = None, view_func = None, **options) : 
    "
        Connects a URL rule.  Works exactly like the `route` decorator.  If a view_func is provided it will be
        registered with the endpoint.

        Basically this example::

            @app.route('/')
            def index():
                pass

        Is equivalent to the following::

            def index():
                pass
            app.add_url_rule('/', 'index', index)

        If the view_func is not provided you will need to connect the endpoint to a view function like so::

            app.view_functions['index'] = index

        Internally`route` invokes `add_url_rule` so if you want to customize the behavior via subclassing you only need
        to change this method.

        :param rule: the URL rule as string
        :type rule: str
        :param endpoint: the endpoint for the registered URL rule. Flask itself assumes the name of the view function as
                         endpoint
        :type endpoint: str
        :param view_func: the function to call when serving a request to the provided endpoint
        :type view_func: types.FunctionType
        :param options: the options to be forwarded to the underlying `werkzeug.routing.Rule` object.  A change
                        to Werkzeug is handling of method options. methods is a list of methods this rule should be
                        limited to (`GET`, `POST` etc.).  By default a rule just listens for `GET` (and implicitly
                        `HEAD`).
        " 
    log_details = { 
        'endpoint' : endpoint, 
        'view_func' : endpoint.__name__, 
} 
    log_details.update (options) 
    logger.debug ('Adding %s', rule, extra = log_details) 
    self.app.add_url_rule (rule, endpoint, view_func, ** options) 

    
    

    Fix the buggy line: 'view_func' : endpoint.__name__ ,
assistant
#Here is Python code to fix the buggy line: 'view_func' : endpoint.

'view_func' : view_func.__name__ ,