Remove forum topic requirement

This commit is contained in:
rubenwardy 2018-05-23 19:40:37 +01:00
parent 243d474bc5
commit 9c728a368c
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
3 changed files with 34 additions and 2 deletions

View File

@ -259,7 +259,7 @@ class Package(db.Model):
repo = db.Column(db.String(200), nullable=True)
website = db.Column(db.String(200), nullable=True)
issueTracker = db.Column(db.String(200), nullable=True)
forums = db.Column(db.Integer, nullable=False)
forums = db.Column(db.Integer, nullable=True)
tags = db.relationship("Tag", secondary=tags, lazy="subquery",
backref=db.backref("packages", lazy=True))

View File

@ -130,7 +130,7 @@ class PackageForm(FlaskForm):
repo = StringField("Repo URL", [Optional(), URL()])
website = StringField("Website URL", [Optional(), URL()])
issueTracker = StringField("Issue Tracker URL", [Optional(), URL()])
forums = IntegerField("Forum Topic ID", [InputRequired(), NumberRange(0,999999)])
forums = IntegerField("Forum Topic ID", [Optional(), NumberRange(0,999999)])
submit = SubmitField("Save")
@app.route("/packages/new/", methods=["GET", "POST"])

View File

@ -0,0 +1,32 @@
"""empty message
Revision ID: ead35f7d446c
Revises: 81e0eb07a3cd
Create Date: 2018-05-23 19:39:29.216273
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ead35f7d446c'
down_revision = '81e0eb07a3cd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('package', 'forums',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('package', 'forums',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###