Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Is this route okay to use?

QUESTION: Would I encounter any problem if I forward with these code below?

Right now it is working without any problem as far as I can see.

So here is my User model. The "paid" column's value will decide if the user can reach a specific page which is only available for the users that have paid the user fee.

class User(db.Model,UserMixin):
__tablename__='Users'id=db.Column(db.Integer,primary_key=True)
email=db.Column(db.String(50),unique=True,nullable=False)
password=db.Column(db.String(60),nullable=False)
paid=db.Column(db.Integer,default='0',nullable=False)
role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))

Here it is one of my routes for activating user account . This route is for when the admin gets a payment notification from the user, the admin will go and activate the user account manually. So I put a basic checkbox and email section in the template. When the admin submit, it changes "paid" column to "1" or "0" to a particular user email address.

#ACTIVATE USER
@admin.route('/user_activate',methods=['GET','POST'])
@login_required
@is_admin()
def activate():


/r/flask
https://redd.it/xxx73l