def unsubscribe_from_basket_action(newsletter):
 def unsubscribe_from_basket(modeladmin, request, queryset):
  'Unsubscribe from Basket.'
  ts = [unsubscribe_from_basket_task.subtask(args=[userprofile.user.email, [newsletter]]) for userprofile in queryset]
  TaskSet(ts).apply_async()
  messages.success(request, 'Basket update started.')
 unsubscribe_from_basket.short_description = 'Unsubscribe from {0}'.format(newsletter)
 func_name = 'unsubscribe_from_basket_{0}'.format(newsletter.replace('-', '_'))
 unsubscribe_from_basket.__name__ = func_name
 return unsubscribe_from_basket

def unsubscribe_from_basket_action ( newsletter ) : def unsubscribe_from_basket ( modeladmin , request , queryset ) : ts = [ unsubscribe_from_basket_task . subtask ( args = [ userprofile . user . email , [ newsletter ] ] ) for userprofile in queryset ] TaskSet ( ts ) . apply_async ( ) messages . success ( request , 'Basket update started.' ) unsubscribe_from_basket . short_description = 'Unsubscribe from {0}' . format ( newsletter ) func_name = 'unsubscribe_from_basket_{0}' . format ( newsletter . replace ( '-' , '_' ) ) unsubscribe_from_basket . __name__ = func_name return unsubscribe_from_basket
unsubscribe from basket action .