Skip to content

Commit fce982e

Browse files
committed
Fixed date format
1 parent 64d3f45 commit fce982e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/dot_ext/tests/test_authorization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def test_dag_expiration_exists(self):
575575
c = Client()
576576
response = c.post('/v1/o/token/', data=token_request_data)
577577
tkn = response.json()
578-
expiration_date_string = strftime('%Y-%m-%d %H:%M:%SZ', expiration_date.timetuple())
578+
expiration_date_string = strftime('%Y-%m-%dT%H:%M:%SZ', expiration_date.timetuple())
579579
self.assertEqual(tkn["access_grant_expiration"][:-4], expiration_date_string[:-4])
580580

581581
def test_revoke_endpoint(self):

apps/dot_ext/views/authorization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,13 @@ def post(self, request, *args, **kwargs):
329329
application=app
330330
)
331331
if dag.expiration_date is not None:
332-
dag_expiry = strftime('%Y-%m-%d %H:%M:%SZ', dag.expiration_date.timetuple())
332+
dag_expiry = strftime('%Y-%m-%dT%H:%M:%SZ', dag.expiration_date.timetuple())
333333
except DataAccessGrant.DoesNotExist:
334334
dag_expiry = ""
335335

336336
elif app.data_access_type == "ONE_TIME":
337337
expires_at = datetime.utcnow() + timedelta(seconds=body['expires_in'])
338-
dag_expiry = expires_at.strftime('%Y-%m-%d %H:%M:%SZ')
338+
dag_expiry = expires_at.strftime('%Y-%m-%dT%H:%M:%SZ')
339339
elif app.data_access_type == "RESEARCH_STUDY":
340340
dag_expiry = ""
341341

0 commit comments

Comments
 (0)