def common_design_update(request, nick):
  view = api.actor_get(api.ROOT, nick)
  if request.POST:
    try:
      validate.nonce(request, 'update_design')

      color = request.POST.get('bg_color')
      repeat = request.POST.get('bg_repeat', 'no-repeat')
      if not repeat:
        repeat = ''

      img = request.FILES.get('bg_image')
      img_url = None
      if img:
        img_url = api.background_upload(request.user,
                                        nick,
                                        img.read())
      api.background_set_actor(request.user,
                               nick,
                               img_url,
                               color,
                               repeat)
      return util.RedirectFlash(view.url() + '/settings/design',
                                'design updated')
    except:
      exception.handle_exception(request)

  if request.GET and request.GET in 'restore':
      api.background_clear_actor(request.user, nick)
      return util.RedirectFlash(view.url() + '/settings/design',
                                'design updated')

  return None
dataset/ETHPy150Open CollabQ/CollabQ/common/views.py/common_design_update/swapped operands of `in`