← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1290909] Re: callable url in LinkAction TemplateSyntaxError

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1290909

Title:
  callable url in LinkAction TemplateSyntaxError

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  According to the doc-string for
  horizon.tables.actions.LinkAction.get_link_url:

   If ``url`` is callable it will call the function.

  Here's the snippit that does the call:

          if callable(self.url):
              return self.url(datum, **self.kwargs)

  However, self.kwargs is not set anywhere (should probably be set in
  __init__).

  
  This will result in an AttributeError or TemplateSyntaxError.

  
  In searching through the code-base, I don't see a single use of a callable url, so perhaps this is dead code?  The dead-code-hypothesis is supported by the classes doc-string which hints that overriding get_link_url is the correct strategy:

      .. attribute:: url

          A string or a callable which resolves to a url to be used as the link
          target. You must either define the ``url`` attribute or override
          the ``get_link_url`` method on the class.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1290909/+subscriptions


References