Skip to content

Commit

Permalink
Merge pull request #96 from Tapo4ek/master
Browse files Browse the repository at this point in the history
Migrations hack
  • Loading branch information
gotlium authored Aug 1, 2017
2 parents 599abaa + f844466 commit 28deb3d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
1 change: 1 addition & 0 deletions dbmail/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def get_settings(key, default):
(BACKEND.get('tts'), _('TTS')),
(BACKEND.get('bot'), _('BOT')),
))
SORTED_BACKEND_CHOICES = sorted(list(BACKEND.items()))

SMS_PROVIDER = get_settings(
'DB_MAILER_SMS_PROVIDER', 'dbmail.providers.nexmo.sms')
Expand Down
53 changes: 53 additions & 0 deletions dbmail/migrations/0014_auto_20170801_1206.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 12:06
from __future__ import unicode_literals

from dbmail.defaults import SORTED_BACKEND_CHOICES, BACKENDS_MODEL_CHOICES, BACKEND
from dbmail.models import SubscriptionDataField
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('dbmail', '0013_auto_20160923_2201'),
]

operations = [
migrations.AlterField(
model_name='maillog',
name='backend',
field=models.CharField(choices=SORTED_BACKEND_CHOICES, db_index=True, default=b'mail', editable=False, max_length=25, verbose_name='Backend'),
),
migrations.AlterField(
model_name='mailsubscription',
name='address',
field=models.CharField(db_index=True, help_text='Must be phone number/email/token', max_length=350, verbose_name='Address'),
),
migrations.AlterField(
model_name='mailsubscription',
name='backend',
field=models.CharField(choices=BACKENDS_MODEL_CHOICES, default=BACKEND.get('mail'), max_length=50, verbose_name='Backend'),
),
migrations.AlterField(
model_name='mailsubscription',
name='data',
field=SubscriptionDataField(blank=True, default=dict, null=True),
),
migrations.AlterField(
model_name='mailsubscription',
name='title',
field=models.CharField(blank=True, max_length=350, null=True),
),
migrations.AlterField(
model_name='mailtemplate',
name='category',
field=models.ForeignKey(blank=True, default=2, null=True, on_delete=django.db.models.deletion.CASCADE, to='dbmail.MailCategory', verbose_name='Category'),
),
migrations.AlterField(
model_name='mailtemplate',
name='from_email',
field=models.ForeignKey(blank=True, default=2, help_text='If not specified, then used default.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='dbmail.MailFromEmail', verbose_name='Message from'),
),
]
4 changes: 2 additions & 2 deletions dbmail/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
PRIORITY_STEPS, UPLOAD_TO, DEFAULT_CATEGORY, AUTH_USER_MODEL,
DEFAULT_FROM_EMAIL, DEFAULT_PRIORITY, CACHE_TTL,
BACKEND, _BACKEND, BACKENDS_MODEL_CHOICES, MODEL_HTMLFIELD,
MODEL_SUBSCRIPTION_DATA_FIELD
MODEL_SUBSCRIPTION_DATA_FIELD, SORTED_BACKEND_CHOICES
)

from dbmail import initial_signals, import_by_string
Expand Down Expand Up @@ -368,7 +368,7 @@ class MailLog(models.Model):
_('Log ID'), max_length=60, editable=False, db_index=True)
backend = models.CharField(
_('Backend'), max_length=25, editable=False, db_index=True,
choices=sorted(list(BACKEND.items())), default='mail')
choices=SORTED_BACKEND_CHOICES, default='mail')
provider = models.CharField(
_('Provider'), max_length=250, editable=False, db_index=True,
default=None, null=True, blank=True)
Expand Down
1 change: 1 addition & 0 deletions demo/demo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

admin.autodiscover()


urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
# url(r'^rosetta/', include('rosetta.urls')),
Expand Down
2 changes: 1 addition & 1 deletion demo/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Sphinx>=1.5.2
redis>=2.10.5
wheel>=0.24.0

django-grappelli==2.7.3
django-grappelli==2.8.3
django-suit==0.2.23
django-ckeditor==5.2.1
django-reversion==2.0.8
Expand Down

0 comments on commit 28deb3d

Please sign in to comment.