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