пофиксил миграцию контактов

remotes/origin/stage6
Alexander Burdeiny 9 years ago
parent 745c23d679
commit 1e51eadd38
  1. 9
      emencia/django/newsletter/migrations/0011_update_contact.py
  2. 5
      fabfile.py

@ -3,10 +3,11 @@ from south.utils import datetime_utils as datetime
from south.db import db from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models, transaction from django.db import models, transaction
from django.conf import settings
from city.models import City from city.models import City
from country.models import Country from country.models import Country
# from emencia.django.newsletter.models import Contact from emencia.django.newsletter.models import Contact
# from theme.models import Theme # from theme.models import Theme
@ -17,9 +18,9 @@ class Migration(DataMigration):
# Note: Don't use "from appname.models import ModelName". # Note: Don't use "from appname.models import ModelName".
# Use orm.ModelName to refer to models in this application, # Use orm.ModelName to refer to models in this application,
# and orm['appname.ModelName'] for models in other applications. # and orm['appname.ModelName'] for models in other applications.
Contact = orm['newsletter.Contact'] # Contact = orm['newsletter.Contact']
moscow = City.objects.language('ru').get(name=u'Москва').pk moscow = settings.MOSCOW_PK
russia = Country.objects.language('ru').get(name=u'Россия').pk russia = settings.RUSSIA_PK
r_cities = set(City.objects.filter(country_id=russia).values_list('pk', flat=True)) r_cities = set(City.objects.filter(country_id=russia).values_list('pk', flat=True))
# with transaction.commit_manually(): # with transaction.commit_manually():
for contact in Contact.objects.prefetch_related('contactsettings').all(): for contact in Contact.objects.prefetch_related('contactsettings').all():

5
fabfile.py vendored

@ -227,6 +227,11 @@ def t1580():
run('python manage.py migrate') run('python manage.py migrate')
run('python manage.py users_to_mailinglist') run('python manage.py users_to_mailinglist')
@ticket
def mailing():
with cd(REMOTE_HOME_DIR):
run('python manage.py migrate')
run('python manage.py newsletter_create_dailymail')
# def stage3_pre_final(): # def stage3_pre_final():
# with cd(REMOTE_HOME_DIR): # with cd(REMOTE_HOME_DIR):

Loading…
Cancel
Save