Commit c10f565c authored by Vaclav Svaton's avatar Vaclav Svaton

Delete job fix and wrong credentials exception handler fix

Delete job is enabled for Configuring state (before job submission to queue).
Fix for unhandled exception during login with the wrong username.
parent 59df83c8
......@@ -90,7 +90,7 @@ namespace HaaSMiddleware.BusinessLogicTier.Logic.JobManagement {
{
log.Info("User " + loggedUser.GetLogIdentification() + " is deleting the job with info Id " + submittedJobInfoId);
SubmittedJobInfo jobInfo = GetSubmittedJobInfoById(submittedJobInfoId, loggedUser);
if (jobInfo.State >= JobState.Finished)
if (jobInfo.State == JobState.Configuring || jobInfo.State >= JobState.Finished)
{
#warning Renci SSH.NET bug - resolving paths when deleting symlink, use ssh delete instead
//FileSystemFactory.GetInstance(jobInfo.NodeType.FileTransferMethod.Protocol)
......
......@@ -44,7 +44,11 @@ namespace HaaSMiddleware.BusinessLogicTier.Logic.UserAndLimitationManagement {
// Get user
AdaptorUser user = unitOfWork.AdaptorUserRepository.GetByName(credentials.Username);
if ( user.Deleted ) {
if (user == null) {
log.Error("Authentication of user " + credentials.Username + " was not successful due to wrong credentials.");
throw new InvalidAuthenticationCredentialsException("Authentication of user " + credentials.Username + " was not successful due to wrong credentials.");
}
if ( user.Deleted ) {
log.Error("User " + user.Username + " that requested authentication was already deleted from the system.");
throw new AuthenticatedUserAlreadyDeletedException("User " + user.Username + " that requested authentication was already deleted from the system.");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment