Skip to content

Commit 4c9c2fe

Browse files
committed
Model additions for timezone & invoices sent out
invoices timezone change Updated latest migration factory addition
1 parent 37516a3 commit 4c9c2fe

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

app/api/schema/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class Meta:
203203

204204
# Event Invoices settings
205205
invoices_sent_day = fields.Integer(allow_none=False, default=1)
206-
timezone = fields.Integer(allow_none=False, default="UTC")
206+
invoices_timezone = fields.Str(allow_none=False, default="UTC")
207207

208208
# Admin Invoice Details
209209
admin_billing_contact_name = fields.Str(allow_none=True)

app/factories/setting.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ class Meta:
104104
facebook_url = common.url_
105105
youtube_url = common.url_
106106

107+
# Event Invoices settings
108+
invoices_sent_day = common.integer_
109+
invoices_timezone = common.timezone_
110+
107111
#
108112
# Generators
109113
#

app/models/setting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Setting(db.Model):
135135
# Event Invoices settings
136136
#
137137
invoices_sent_day = db.Column(db.Integer, nullable=False, default=1)
138-
timezone = db.Column(db.String, nullable=False, default="UTC")
138+
invoices_timezone = db.Column(db.String, nullable=False, default="UTC")
139139
#
140140
# Admin Invoice Details
141141
#
@@ -219,7 +219,7 @@ def __init__(self,
219219
alipay_publishable_key=None,
220220
alipay_secret_key=None,
221221
invoices_sent_day=None,
222-
timezone=None,
222+
invoices_timezone=None,
223223
admin_billing_contact_name=None,
224224
admin_billing_phone=None,
225225
admin_billing_email=None,
@@ -302,7 +302,7 @@ def __init__(self,
302302
self.alipay_secret_key = alipay_secret_key
303303

304304
# Event Invoice settings
305-
self.timezone = timezone
305+
self.invoices_timezone = invoices_timezone
306306
self.invoices_sent_day = invoices_sent_day
307307

308308
# Admin Invoice Details
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""empty message
2+
3+
Revision ID: 3ac0865a789d
4+
Revises: 2c7ff9781032
5+
Create Date: 2019-07-01 16:07:58.026171
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
import sqlalchemy_utils
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision = '3ac0865a789d'
16+
down_revision = '4279c2ac565b'
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.add_column('settings', sa.Column('invoices_sent_day', sa.Integer(), server_default='1', nullable=False))
22+
op.add_column('settings', sa.Column('invoices_timezone', sa.String(), server_default='UTC', nullable=False))
23+
# ### end Alembic commands ###
24+
25+
26+
def downgrade():
27+
# ### commands auto generated by Alembic - please adjust! ###
28+
op.drop_column('settings', 'invoices_timezone')
29+
op.drop_column('settings', 'invoices_sent_day')
30+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)