1+ import datetime
12import uuid
23
34from django .core .exceptions import ValidationError as DjangoValidationError
5+ from django .conf import settings
46from django .db .models import OuterRef , Subquery , F
57
68from share .oaipmh import errors as oai_errors
79from share .oaipmh .verbs import OAIVerb
810from share .oaipmh .response_renderer import OAIRenderer
9- from share .oaipmh .util import format_datetime
10- from share .util .fromisoformat import fromisoformat
1111from share import models as share_db
1212from trove import models as trove_db
13+ from trove .util .datetime import datetime_isoformat_z as format_datetime
1314from trove .vocab .namespaces import OAI_DC
1415
1516
@@ -18,7 +19,7 @@ class OaiPmhRepository:
1819 REPOSITORY_IDENTIFIER = 'share.osf.io'
1920 IDENTIFER_DELIMITER = ':'
2021 GRANULARITY = 'YYYY-MM-DD'
21- ADMIN_EMAILS = [
'[email protected] ' ]
22+ ADMIN_EMAILS = [settings . SHARE_SUPPORT_EMAIL ]
2223
2324 # TODO better way of structuring this than a bunch of dictionaries?
2425 # this dictionary's keys are `metadataPrefix` values
@@ -206,7 +207,7 @@ def _get_indexcard_page_queryset(self, kwargs, catch=True, last_id=None):
206207 )
207208 if 'from' in kwargs :
208209 try :
209- _from = fromisoformat (kwargs ['from' ])
210+ _from = datetime . datetime . fromisoformat (kwargs ['from' ])
210211 except ValueError :
211212 if not catch :
212213 raise
@@ -217,7 +218,7 @@ def _get_indexcard_page_queryset(self, kwargs, catch=True, last_id=None):
217218 )
218219 if 'until' in kwargs :
219220 try :
220- _until = fromisoformat (kwargs ['until' ])
221+ _until = datetime . datetime . fromisoformat (kwargs ['until' ])
221222 except ValueError :
222223 if not catch :
223224 raise
@@ -291,12 +292,12 @@ def _get_resumption_token(self, kwargs, last_id):
291292 _until = None
292293 if 'from' in kwargs :
293294 try :
294- _from = fromisoformat (kwargs ['from' ])
295+ _from = datetime . datetime . fromisoformat (kwargs ['from' ])
295296 except ValueError :
296297 self .errors .append (oai_errors .BadArgument ('Invalid value for' , 'from' ))
297298 if 'until' in kwargs :
298299 try :
299- _until = fromisoformat (kwargs ['until' ])
300+ _until = datetime . datetime . fromisoformat (kwargs ['until' ])
300301 except ValueError :
301302 self .errors .append (oai_errors .BadArgument ('Invalid value for' , 'until' ))
302303 _set_spec = kwargs .get ('set' , '' )
0 commit comments