Skip to content

Commit 2cb4977

Browse files
author
Hieu Lam - TMA
authored
fix-9019: Cannot store all data for video translations channels (#9027)
1 parent 406f30d commit 2cb4977

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

app/api/translation_channels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TranslationChannelsList(ResourceList):
1616
"""Get list of Translation Channels"""
1717

1818
@staticmethod
19-
def before_get(kwargs):
19+
def before_get(_args, kwargs):
2020
"""Function called when requesting Translation Channels List"""
2121
stream_id = kwargs.get("video_stream_id")
2222
if stream_id:
@@ -55,7 +55,7 @@ class TranslationChannelsListPost(ResourceList):
5555
"""Post a list of Translation Channels"""
5656

5757
@staticmethod
58-
def before_post(data):
58+
def before_post(_args, _kwargs, data):
5959
"""Function called when posting to the Translation Channel List"""
6060
require_relationship(['video_stream', 'channel'], data)
6161
video_stream = db.session.query(

app/models/custom_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class TYPE:
209209
min = db.Column(db.Integer, default=0, nullable=True)
210210
max = db.Column(db.Integer, default=10, nullable=True)
211211
main_language = db.Column(db.String)
212-
is_allow_edit = db.Column(db.Boolean, default=False)
212+
is_allow_edit = db.Column(db.Boolean, default=False, nullable=False)
213213

214214
@property
215215
def identifier(self):

migrations/versions/rev-2023-07-19-10:01:32-3b784f9c98c7_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""empty message
22
33
Revision ID: 3b784f9c98c7
4-
Revises: 2b19596af9f0
4+
Revises: 9881f067213b
55
Create Date: 2023-07-19 10:01:32.456857
66
77
"""
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""empty message
2+
3+
Revision ID: 21c79d253f21
4+
Revises: c4100d6a5609
5+
Create Date: 2023-08-01 09:43:36.773097
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = '21c79d253f21'
15+
down_revision = 'c4100d6a5609'
16+
17+
18+
def upgrade():
19+
# ### commands auto generated by Alembic - please adjust! ###
20+
op.create_table('translation_channels',
21+
sa.Column('id', sa.Integer(), nullable=False),
22+
sa.Column('video_stream_id', sa.Integer(), nullable=True),
23+
sa.Column('channel_id', sa.Integer(), nullable=True),
24+
sa.Column('name', sa.String(), nullable=True),
25+
sa.Column('url', sa.String(), nullable=True),
26+
sa.ForeignKeyConstraint(['channel_id'], ['video_channels.id'], ondelete='CASCADE'),
27+
sa.ForeignKeyConstraint(['video_stream_id'], ['video_streams.id'], ondelete='CASCADE'),
28+
sa.PrimaryKeyConstraint('id')
29+
)
30+
# ### end Alembic commands ###
31+
32+
33+
def downgrade():
34+
# ### commands auto generated by Alembic - please adjust! ###
35+
op.drop_table('translation_channels')
36+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)