def restore_design(request):
  if request.method == 'POST':
    ids = request.POST.getlist('designs_selection')
    designs = dict([(design_id, authorized_get_design(request, design_id)) for design_id in ids])

    if None in designs.values():
      LOG.error(','.join([key for key, name in designs.items() if name is None]) % 'Cannot restore non-existent design(s) %s')
      return list_designs(request)

    for design in designs.values():
      design.doc.get().restore_from_trash()
    return redirect(reverse(get_app_name(request) + ':list_designs'))
  else:
    return render('confirm.mako', request, {'url': request.path, 'title': _('Restore design(s)?')})
dataset/ETHPy150Open cloudera/hue/apps/beeswax/src/beeswax/views.py/restore_design/swapped operands of `%`