Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update_profile():
"""User profile update."""
form = UserUpdateProfileForm()
form.user_name.data = flask_login.current_user.name
if form.validate_on_submit():
set_user_by_instance(
db.session,
user=flask_login.current_user,
lastname=form.lastname.data,
firstname=form.firstname.data,
email=form.email.data,
linkedin_url=form.linkedin_url.data,
twitter_url=form.twitter_url.data,
facebook_url=form.facebook_url.data,
google_url=form.google_url.data,
github_url=form.github_url.data,
website_url=form.website_url.data,
is_want_news=form.is_want_news.data
)
validators.DataRequired(), validators.Length(min=1, max=20),
_space_check])
firstname = StringField('firstname', [validators.DataRequired()])
lastname = StringField('lastname', [validators.DataRequired()])
email = StringField('email', [validators.DataRequired()])
linkedin_url = StringField('linkedin_url')
twitter_url = StringField('twitter_url')
facebook_url = StringField('facebook_url')
google_url = StringField('google_url')
github_url = StringField('github_url')
website_url = StringField('website_url')
bio = StringField('bio')
is_want_news = BooleanField()
class UserCreateProfileForm(UserUpdateProfileForm):
"""User profile form.
Attributes
----------
user_name : str
The user name.
password : str
The user password.
firstname : str
The user's first name.
lastname : str
The user's last name.
email : str
The user's email address.
linkedin_url : str, default == ''
The user's LinkedIn URL.