I am following the Miguel Grinberg book on Flask Web Development and while authorising I came across the following code snippet where unconfirmed users are either given access if they are confirmed or are redirected to the same page.
@auth.route('/unconfirmed')
def unconfirmed():
if current_user.is_anonymous() or current_user.confirmed:
return redirect(url_for('main.index'))
return render_template('auth/unconfirmed.html')
I want to clarify the role of
current_user.is_anonymous().
Why is this particular condition also checked? Also, what will happen if this condition is satisfied (when i tested it was transferring to 404.html which I dont understand why?