title: Why am i getting TypeError: object of type 'NoneType' has no len() error (practically copied code from a working part of my code)
body: <p>I am fresh into this whole programming thing. Currently, I am working on a flask, python, SQLite project. I had an edit form set up to edit a listing the user posted. It worked great. Then I, copied that code to make a user info edit form for it and now I am getting TypeError: object of type 'NoneType' has no len() with essentially the exact same code.</p>
  
  <p>HTML code.
  This code is inside a modal , if that means anything.</p>
  
  <pre><code>&lt;form action="/edituserinfo" method="post"&gt;
                          &lt;label for="name" style="float:left"&gt;Name:&lt;/label&gt;&lt;br /&gt;
                          &lt;input class="form-control" name="name" style="width:100%" placeholder="{{ user[0]['username'] }}"&gt;
                          &lt;label for="email" style="float:left"&gt;Email:&lt;/label&gt;&lt;br /&gt;
                          &lt;input class="form-control" name="email" style="width:100%" placeholder="{{ user[0]['email'] }}"&gt;
                          &lt;label for="city" style="float:left"&gt;City:&lt;/label&gt;&lt;br /&gt;
                          &lt;input class="form-control" name="city" style="width:100%" placeholder="{{ user[0]['city'] }}"&gt;
                      &lt;button type="submit" class="btn btn-lg btn-success btn-block"&gt;SAVE!&lt;/button&gt;
                  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my python code.</p>
  
  <pre><code>@app.route("/edituserinfo", methods=["GET", "POST"])
  @login_required
  def edituserinfo():
  
      if request.method == "POST":
          user = session["user_id"]
          column = ["username", "email", "city"]
          for title in column:
              if len(request.form.get(title)) != 0:
                  value = request.form.get(title)
                  db.execute("UPDATE users SET %s = :edit WHERE id = :id" %(title), {"edit":value, "id":user})
                  db.commit()
          return redirect("/account")
  
      else:
          return redirect("/account")
  </code></pre>
  
  <p>Any help, advice would be appreciated!!
  Thanks!</p>