contact email field in DB #151

This commit is contained in:
rimu 2024-04-12 16:22:58 +12:00
parent 5e20658474
commit e135cf735f
3 changed files with 33 additions and 4 deletions

View file

@ -303,10 +303,6 @@ def list_files(directory):
@bp.route('/test') @bp.route('/test')
def test(): def test():
x = recently_upvoted_posts(1)
return x
md = "::: spoiler I'm all for ya having fun and your right to hurt yourself.\n\nI am a former racer, commuter, and professional Buyer for a chain of bike shops. I'm also disabled from the crash involving the 6th and 7th cars that have hit me in the last 170k+ miles of riding. I only barely survived what I simplify as a \"broken neck and back.\" Cars making U-turns are what will get you if you ride long enough, \n\nespecially commuting. It will look like just another person turning in front of you, you'll compensate like usual, and before your brain can even register what is really happening, what was your normal escape route will close and you're going to crash really hard. It is the only kind of crash that your intuition is useless against.\n:::" md = "::: spoiler I'm all for ya having fun and your right to hurt yourself.\n\nI am a former racer, commuter, and professional Buyer for a chain of bike shops. I'm also disabled from the crash involving the 6th and 7th cars that have hit me in the last 170k+ miles of riding. I only barely survived what I simplify as a \"broken neck and back.\" Cars making U-turns are what will get you if you ride long enough, \n\nespecially commuting. It will look like just another person turning in front of you, you'll compensate like usual, and before your brain can even register what is really happening, what was your normal escape route will close and you're going to crash really hard. It is the only kind of crash that your intuition is useless against.\n:::"
return markdown_to_html(md) return markdown_to_html(md)

View file

@ -1278,6 +1278,7 @@ class Site(db.Model):
last_active = db.Column(db.DateTime, default=utcnow) last_active = db.Column(db.DateTime, default=utcnow)
log_activitypub_json = db.Column(db.Boolean, default=False) log_activitypub_json = db.Column(db.Boolean, default=False)
default_theme = db.Column(db.String(20), default='') default_theme = db.Column(db.String(20), default='')
contact_email = db.Column(db.String(255), default='')
@staticmethod @staticmethod
def admins() -> List[User]: def admins() -> List[User]:

View file

@ -0,0 +1,32 @@
"""contact email
Revision ID: 91a931afd6d9
Revises: 08b3f718df5d
Create Date: 2024-04-12 16:22:32.137053
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '91a931afd6d9'
down_revision = '08b3f718df5d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('site', schema=None) as batch_op:
batch_op.add_column(sa.Column('contact_email', sa.String(length=255), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('site', schema=None) as batch_op:
batch_op.drop_column('contact_email')
# ### end Alembic commands ###