2024-04-24 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression in the PyPAD subsystem that broke null datetime
	handling.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2024-04-23 15:47:26 -04:00
parent 8e08dad4a4
commit ed481ec3f1
3 changed files with 13 additions and 2 deletions

View File

@ -24709,3 +24709,6 @@
* Added a 'tempdir_test' test harness.
2024-04-22 Fred Gleason <fredg@paravelsystems.com>
* Added an 'Ubuntu 24.04 LTS' section to 'INSTALL'.
2024-04-24 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in the PyPAD subsystem that broke null datetime
handling.

View File

@ -90,6 +90,8 @@ class Update(object):
def __fromIso8601(self,string):
try:
if len(string)==0:
return datetime.datetime()
return datetime.datetime.strptime(string.strip()[:19],'%Y-%m-%dT%H:%M:%S')
except AttributeError:
return ''

View File

@ -20,6 +20,7 @@
#include "rdapplication.h"
#include "rdconf.h"
#include "rddatetime.h"
#include "rddb.h"
#include "rddebug.h"
#include "rdescape_string.h"
@ -3186,7 +3187,7 @@ void RDLogPlay::SendNowNext()
// Header Fields
//
QJsonObject jo0;
jo0.insert("dateTime",QDateTime::currentDateTime().toString(Qt::ISODate));
jo0.insert("dateTime",RDWriteXmlDateTime(QDateTime::currentDateTime()));
jo0.insert("hostName",rda->station()->name());
jo0.insert("shortHostName",rda->station()->shortName());
jo0.insert("machine",1+play_id);
@ -3332,7 +3333,12 @@ QJsonValue RDLogPlay::GetPadJson(const QString &name,RDLogLine *ll,
return QJsonValue();
}
jo0.insert("startDateTime",start_datetime.toString(Qt::ISODate));
if(start_datetime.isNull()) {
jo0.insert("startDateTime",QJsonValue());
}
else {
jo0.insert("startDateTime",RDWriteXmlDateTime(start_datetime));
}
jo0.insert("lineNumber",line);
jo0.insert("lineId",ll->id());
jo0.insert("eventType",RDLogLine::typeText(ll->type()));