We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 182c44e commit 1d6dfd4Copy full SHA for 1d6dfd4
api/drf_views.py
@@ -1,3 +1,5 @@
1
+from datetime import datetime
2
+from pytz import utc
3
from rest_framework.status import HTTP_201_CREATED, HTTP_200_OK
4
from rest_framework.generics import GenericAPIView, CreateAPIView, UpdateAPIView
5
from rest_framework.response import Response
@@ -821,6 +823,9 @@ def map_many_to_many_relations(self, data):
821
823
if prop in data:
822
824
del data[prop]
825
826
+ if 'start_date' in data:
827
+ data['start_date'] = datetime.strptime(data['start_date'], '%Y-%m-%dT%H:%M:%S.%f%z')\
828
+ .replace(tzinfo=utc)
829
return data, locations, meta, partners
830
831
def save_locations(self, instance, locations, is_update=False):
0 commit comments