Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pycsw/ogc/api/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#
# =================================================================

from datetime import datetime
from datetime import datetime, UTC
import json
import logging
from operator import itemgetter
Expand Down Expand Up @@ -913,7 +913,7 @@ def items(self, headers_, json_post_data, args, collection='metadata:main'):
'hreflang': self.config['server']['language']
})

response['timeStamp'] = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%fZ')
response['timeStamp'] = datetime.now(UTC).strftime('%Y-%m-%dT%H:%M:%S.%fZ')

if headers_['Content-Type'] == 'text/html':
response['title'] = self.config['metadata']['identification']['title']
Expand Down
4 changes: 2 additions & 2 deletions pycsw/ogc/pubsub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#
# =================================================================

from datetime import datetime
from datetime import datetime, UTC
import json
import uuid
from typing import Union
Expand Down Expand Up @@ -87,7 +87,7 @@ def generate_ogc_cloudevent(type_: str, media_type: str,
'source': 'TODO',
'subject': subject,
'id': str(uuid.uuid4()),
'time': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ'),
'time': datetime.now(UTC).strftime('%Y-%m-%dT%H:%M:%SZ'),
'datacontenttype': media_type,
# 'dataschema': 'TODO',
'data': data2
Expand Down
6 changes: 3 additions & 3 deletions pycsw/plugins/profiles/iso19115p3/iso19115p3.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ def write_record(self, result, esn, outputschema, queryables, caps=None):
try:
val = util.getqattr(result, queryables['mdb:ResourceLanguage']['dbcol'])
except Exception as e:
print(f"{queryables=}")
print("exc=", e)
LOGGER.error(f"{queryables=}")
LOGGER.error("exc=", e)
if val is None:
val = util.getqattr(result, queryables['mdb:Language']['dbcol'])
lang_code = build_path(node,['mdb:defaultLocale', 'lan:PT_Locale', 'lan:language', 'lan:LanguageCode'], self.namespaces)
Expand Down Expand Up @@ -466,7 +466,7 @@ def write_record(self, result, esn, outputschema, queryables, caps=None):
# Organisation address
self._write_contact_address(ci_resp, ci_contact, **contact)
except Exception as err:
print(f"failed to parse contacts json of {cjson}: {err}")
LOGGER.error(f"failed to parse contacts json of {cjson}: {err}")

# Creation date for record
val = util.getqattr(result, queryables['mdb:Modified']['dbcol'])
Expand Down