fix null timezone
This commit is contained in:
parent
f146829d10
commit
281d57996e
|
|
@ -1,5 +1,7 @@
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
|
from django.db.models import Q
|
||||||
|
|
||||||
from transfer.models import Establishments
|
from transfer.models import Establishments
|
||||||
from transfer.serializers.establishment import EstablishmentSerializer
|
from transfer.serializers.establishment import EstablishmentSerializer
|
||||||
|
|
||||||
|
|
@ -8,7 +10,8 @@ def transfer_establishment():
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
old_establishments = Establishments.objects.exclude(
|
old_establishments = Establishments.objects.exclude(
|
||||||
type='Wineyard',
|
Q(type='Wineyard') |
|
||||||
|
Q(location__timezone__isnull=True)
|
||||||
).prefetch_related(
|
).prefetch_related(
|
||||||
'establishmentinfos_set',
|
'establishmentinfos_set',
|
||||||
'schedules_set',
|
'schedules_set',
|
||||||
|
|
@ -24,14 +27,12 @@ def transfer_establishment():
|
||||||
'phone': item.phone,
|
'phone': item.phone,
|
||||||
'created': item.created_at,
|
'created': item.created_at,
|
||||||
'description': {},
|
'description': {},
|
||||||
'tz': None,
|
|
||||||
'website': None,
|
'website': None,
|
||||||
'facebook': None,
|
'facebook': None,
|
||||||
'twitter': None,
|
'twitter': None,
|
||||||
'lafourchette': None,
|
'lafourchette': None,
|
||||||
'booking': None,
|
'booking': None,
|
||||||
'schedules': None,
|
'schedules': None,
|
||||||
'location': None,
|
|
||||||
'email': None,
|
'email': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from django.db import transaction
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from establishment.models import Establishment, ContactEmail, ContactPhone, EstablishmentType
|
from establishment.models import Establishment, ContactEmail, ContactPhone, EstablishmentType
|
||||||
from location.models import Address
|
# from location.models import Address
|
||||||
from timetable.models import Timetable
|
from timetable.models import Timetable
|
||||||
from utils.legacy_parser import parse_legacy_schedule_content
|
from utils.legacy_parser import parse_legacy_schedule_content
|
||||||
from utils.slug_generator import generate_unique_slug
|
from utils.slug_generator import generate_unique_slug
|
||||||
|
|
@ -24,7 +24,7 @@ class EstablishmentSerializer(serializers.ModelSerializer):
|
||||||
facebook = serializers.CharField(allow_null=True, allow_blank=True)
|
facebook = serializers.CharField(allow_null=True, allow_blank=True)
|
||||||
twitter = serializers.CharField(allow_null=True, allow_blank=True)
|
twitter = serializers.CharField(allow_null=True, allow_blank=True)
|
||||||
booking = serializers.CharField(allow_null=True, allow_blank=True)
|
booking = serializers.CharField(allow_null=True, allow_blank=True)
|
||||||
tz = serializers.CharField(allow_null=True, allow_blank=True)
|
tz = serializers.CharField()
|
||||||
created = serializers.DateTimeField(format='%m-%d-%Y %H:%M:%S')
|
created = serializers.DateTimeField(format='%m-%d-%Y %H:%M:%S')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user