#71 Changed generator implementation to list in manage_subscription method
Merged 8 years ago by ralph. Opened 8 years ago by shalini.
shalini/fedora-hubs bugfix/subscriptions  into  develop

@@ -53,10 +53,12 @@ 

  

  # function hyperlinks the hubs in the subscription widget

  def manage_subscriptions(items):

-     for index, item in enumerate(items[0:3]):

-         link = '<a href="{link}">{item}</a>'.format(link=flask.url_for(

-             'hub', name=item), item=item)

-         yield link

+     return [

+         '<a href="{link}">{item}</a>'.format(

+             link=flask.url_for('hub', name=item),

+             item=item,

+         ) for index, item in enumerate(items[0:3])

+     ]

  

  

  def should_invalidate(message, session, widget):

no initial comment

Looks good to me functionally. Can we break it out onto separate lines a little differently just to for readability? Something like

return [
    '<a href="{link}">{item}</a>'.format(
        link=flask.url_for('hub', name=item),
        item=item,
    ) for index, item in enumerate(items[0:3])
]

yeah, sure, will do it

Looks good. Thanks for the fix @shalini!

Metadata