title: AttributeError: 'dict' object has no attribute 'is_active' (PyMongo And Flask)
body: <pre><code>@app.route("/register", methods=['GET', 'POST'])
  def register():
      form = RegistrationForm()
      if form.validate_on_submit():
          users = mongo.db.users
          hash_password=bcrypt.generate_password_hash(form.password.data).decode('utf-8')
          eml=form.email.data
          gen=form.gender.data
          ctry=form.country.data
          profile={'name' : form.username.data, 'password' :hash_password,'email':eml,'gender':gen,'country':ctry}
          users.insert(profile)
          #users.insert({'name' : form.username.data, 'password' :form.password.data})
          flash(f'Your has been Account created for Username {form.username.data}!, You can login', 'success')
          return redirect(url_for('login'))
          #return redirect(url_for('home'))
      return render_template('register.html', title='Register', form=form)
  
  @app.route("/login", methods=['GET', 'POST'])
  def login():
      form = LoginForm()
      if form.validate_on_submit():
          users = mongo.db.users
          loginuser = users.find_one({'email' : form.email.data})
          if loginuser and bcrypt.check_password_hash(loginuser['password'],form.password.data):
          #if form.email.data == 'admin@blog.com' and form.password.data == 'password':
              login_user(loginuser,remember=form.data.remember)
              return redirect(url_for('home'))
              #flash('You have been logged in!', 'success')
              #return redirect(url_for('home'))
          else:
              flash('Login Unsuccessful. Please check username and password', 'danger')
      return render_template('login.html', title='Login', form=form)
  </code></pre>
  
  <p>I have created a simple register and login method using flask with combination of pymongo.
  Now for user session management i am using flask_login 
  but it gives me this error 
  AttributeError: 'dict' object has no attribute 'is_active'</p>
  
  <p>the solution that i found different post was to add UserMaxIn in UserClass 
  but i dont have any class for User Model and i dont want to make it either</p>
  
  <p>what would be the solution of this error  ?</p>