2021-12-12 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdxport(8) that caused the 'SaveLog' WebAPI call
	to fail if the target log didn't exist.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-12-12 14:59:57 -05:00
parent 527fadb8d7
commit b519674128
2 changed files with 10 additions and 1 deletions

View File

@ -22756,3 +22756,6 @@
2021-12-12 Fred Gleason <fredg@paravelsystems.com>
* Added a 'linkLength' field to the return XML for the 'ListLog'
WebAPI call.
2021-12-12 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdxport(8) that caused the 'SaveLog' WebAPI call
to fail if the target log didn't exist.

View File

@ -257,6 +257,7 @@ void Xport::SaveLog()
QDate start_date;
QDate end_date;
int line_quantity;
QString err_msg;
//
// Header Data
@ -499,7 +500,12 @@ void Xport::SaveLog()
RDLog *log=new RDLog(log_name);
if(!log->exists()) {
XmlExit("No such log",404,"logs.cpp",LINE_NUMBER);
if(!RDLog::create(log_name,service_name,QDate(),rda->user()->name(),
&err_msg,rda->config())) {
XmlExit("No such log ["+err_msg+"]",400,"logs.cpp",LINE_NUMBER);
}
SendNotification(RDNotification::LogType,RDNotification::AddAction,
QVariant(log->name()));
}
if(lock_guid.isEmpty()) {
QString username=rda->user()->name();