testing typo
This commit is contained in:
parent
eeacc51ec2
commit
0f8aa3c2d4
@ -4,19 +4,19 @@ from flask_login import UserMixin
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
|
||||
followers = db.Table('followers',
|
||||
db.Column('follower_id', db.Integer, db.ForeignKey('user.id')),
|
||||
db.Column('followed_id', db.Integer, db.ForeignKey('user.id'))
|
||||
db.Column('follower_id', db.Integer, db.ForeignKey('User.id')),
|
||||
db.Column('followed_id', db.Integer, db.ForeignKey('User.id'))
|
||||
)
|
||||
|
||||
channel_association = db.Table('channel_association',
|
||||
db.Column('channel_id', db.String(30), db.ForeignKey('channel.id')),
|
||||
db.Column('user_id', db.Integer, db.ForeignKey('user.id'))
|
||||
) # Association: CHANNEL --followed by--> [USERS]
|
||||
db.Column('User_id', db.Integer, db.ForeignKey('User.id'))
|
||||
) # Association: CHANNEL --followed by--> [UserS]
|
||||
|
||||
twitter_association = db.Table('twitter_association',
|
||||
db.Column('account_id', db.String(30), db.ForeignKey('twitterAccount.id')),
|
||||
db.Column('user_id', db.Integer, db.ForeignKey('user.id'))
|
||||
) # Association: ACCOUNT --followed by--> [USERS]
|
||||
db.Column('User_id', db.Integer, db.ForeignKey('User.id'))
|
||||
) # Association: ACCOUNT --followed by--> [UserS]
|
||||
|
||||
class User(UserMixin, db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
|
@ -486,6 +486,7 @@ def allowed_file(filename):
|
||||
|
||||
@app.route('/register', methods=['GET', 'POST'])
|
||||
def register():
|
||||
form = RegistrationForm()
|
||||
if current_user.is_authenticated:
|
||||
return redirect(url_for('index'))
|
||||
|
||||
@ -496,7 +497,7 @@ def register():
|
||||
REGISTRATIONS = False
|
||||
except:
|
||||
REGISTRATIONS = True
|
||||
form = RegistrationForm()
|
||||
|
||||
if form.validate_on_submit():
|
||||
if User.query.filter_by(username=form.username.data).first():
|
||||
flash("This username is taken! Try with another.")
|
||||
@ -508,6 +509,7 @@ def register():
|
||||
db.session.commit()
|
||||
flash('Congratulations, you are now a registered user!')
|
||||
return redirect(url_for('login'))
|
||||
|
||||
return render_template('register.html', title='Register', registrations=REGISTRATIONS, form=form)
|
||||
|
||||
@app.route('/error/<errno>')
|
||||
|
Reference in New Issue
Block a user