diff --git a/Dockerfile b/Dockerfile index 6d964ca..ece5a10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -# Use the base image containing Python 3.8, NodeJS, npm, mono-complete compiler and java compiler +# Python3.12.7 Base Image FROM python:3.12.7 # Image Labels. Update values for each build LABEL Name="Skill-Forge" -LABEL Version="1.4.6" +LABEL Version="1.4.7" LABEL Release="public" -LABEL ReleaseDate="20.10.2024" +LABEL ReleaseDate="23.10.2024" LABEL Description="Skill Forge is a open-source platform for learning and practicing programming languages." LABEL Maintainer="Aleksandar Karastoyanov " LABEL License="GNU GPL v3.0 license" diff --git a/app/forms.py b/app/forms.py index a8baff9..1b7b6a9 100644 --- a/app/forms.py +++ b/app/forms.py @@ -51,7 +51,7 @@ class RegistrationForm(FlaskForm): username = StringField('', render_kw={'placeholder': 'Username'}, validators=[DataRequired(message="Username is required"), Length(min=4, max=25, message="Username must be between 4 and 25 characters.")]) first_name = StringField('', render_kw={'placeholder': 'First name'}, validators=[DataRequired(message="First name is required"), Length(min=1, max=30, message="First name must be between 1 and 30 characters.")]) last_name = StringField('', render_kw={'placeholder': 'Last name'}, validators=[DataRequired(message="Last name is required"), Length(min=1, max=30, message="Last name must be between 1 and 30 characters.")]) - email = StringField('', render_kw={'placeholder': 'Email address'}, validators=[DataRequired(message="Email address is required"), Email(message="Invalid emal address"), latin_characters_only]) + email = StringField('', render_kw={'placeholder': 'Email address'}, validators=[DataRequired(message="Email address is required"), Email(message="Invalid email address"), latin_characters_only]) password = PasswordField('', validators=[ DataRequired(message="Password is required"), Length(min=10, max=50, message='Password must be between 10 and 50 characters.'), diff --git a/app/models.py b/app/models.py index 93f215c..d5ca5be 100644 --- a/app/models.py +++ b/app/models.py @@ -11,6 +11,10 @@ script_dir = os.path.dirname(os.path.abspath(__file__)) +# Set the default avatar +def set_default_avatar(): + with open('app/static/images/achievements-icons/General/quest_approved.png', 'rb') as f: + return f.read() ########### Define the User model ########### class User(UserMixin, db.Model): @@ -24,7 +28,7 @@ class User(UserMixin, db.Model): xp = db.Column(db.Integer, default=0, nullable=False) level = db.Column(db.Integer, default=1, nullable=False) rank = db.Column(db.String(30), default="Neophyte") - avatar = db.Column(db.LargeBinary, default=None) + avatar = db.Column(db.LargeBinary, default=set_default_avatar, nullable=False) date_registered = db.Column(db.DateTime, default=datetime.now(), nullable=False) password = db.Column(db.String(120), nullable=False) total_solved_quests = db.Column(db.Integer, default=0, nullable=False) diff --git a/setup.cfg b/setup.cfg index 05f65ac..2292a0f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] name = Skill-Forge -version = 1.4.6 -release_date = 20.10.2024 +version = 1.4.7 +release_date = 23.10.2024 description = Skill Forge is a open-source platform for learning and practicing programming languages. author = Aleksandar Karastoyanov author_email = karastoqnov.alexandar@gmail.com