-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into upgrade-local-dev
- Loading branch information
Showing
34 changed files
with
342 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ MAINTAINER RAMS Project "[email protected]" | |
LABEL version.rams-core ="0.1" | ||
|
||
# install ghostscript and gettext-base | ||
RUN apt-get update && apt-get install -y ghostscript gettext-base vim && rm -rf /var/lib/apt/lists/* | ||
RUN apt-get update && apt-get install -y ghostscript dnsutils gettext-base vim && rm -rf /var/lib/apt/lists/* | ||
|
||
ADD requirements*.txt plugins/uber/ | ||
ADD setup.py plugins/uber/ | ||
|
60 changes: 60 additions & 0 deletions
60
alembic/versions/c31a2e5b6fbd_adding_last_send_time_to_automated_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
"""Adding last_send_time to automated emails | ||
Revision ID: c31a2e5b6fbd | ||
Revises: fa2deb095760 | ||
Create Date: 2022-12-28 07:18:23.125853 | ||
""" | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'c31a2e5b6fbd' | ||
down_revision = 'fa2deb095760' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
import residue | ||
|
||
|
||
|
||
try: | ||
is_sqlite = op.get_context().dialect.name == 'sqlite' | ||
except Exception: | ||
is_sqlite = False | ||
|
||
if is_sqlite: | ||
op.get_context().connection.execute('PRAGMA foreign_keys=ON;') | ||
utcnow_server_default = "(datetime('now', 'utc'))" | ||
else: | ||
utcnow_server_default = "timezone('utc', current_timestamp)" | ||
|
||
def sqlite_column_reflect_listener(inspector, table, column_info): | ||
"""Adds parenthesis around SQLite datetime defaults for utcnow.""" | ||
if column_info['default'] == "datetime('now', 'utc')": | ||
column_info['default'] = utcnow_server_default | ||
|
||
sqlite_reflect_kwargs = { | ||
'listeners': [('column_reflect', sqlite_column_reflect_listener)] | ||
} | ||
|
||
# =========================================================================== | ||
# HOWTO: Handle alter statements in SQLite | ||
# | ||
# def upgrade(): | ||
# if is_sqlite: | ||
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op: | ||
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# else: | ||
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# | ||
# =========================================================================== | ||
|
||
|
||
def upgrade(): | ||
op.add_column('automated_email', sa.Column('last_send_time', residue.UTCDateTime(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('automated_email', 'last_send_time') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
cherrypy==17.3.0 | ||
celery==4.1.1 | ||
celery==5.1.2 | ||
python-dateutil==2.6.0 | ||
psycopg2 | ||
py3k-bcrypt==0.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.