ruanwenjun commented on a change in pull request #6668:
URL: https://github.com/apache/dolphinscheduler/pull/6668#discussion_r740967667



##########
File path: 
dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java
##########
@@ -177,7 +177,7 @@ public Long createOrUpdateProcessDefinition(String userName,
         long projectCode = project.getCode();
         Map<String, Object> verifyProcessDefinitionExists = 
processDefinitionService.verifyProcessDefinitionName(user, projectCode, name);
 
-        if (verifyProcessDefinitionExists.get(Constants.STATUS) != 
Status.SUCCESS) {
+        if (verifyProcessDefinitionExists.get(Constants.STATUS) == 
Status.PROCESS_DEFINITION_NAME_EXIST) {

Review comment:
       I see the code, it seems the status may also be `PROJECT_NOT_FOUNT` or 
`USER_NO_OPERATION_PROJECT_PERM` here?

##########
File path: 
dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java
##########
@@ -177,7 +177,7 @@ public Long createOrUpdateProcessDefinition(String userName,
         long projectCode = project.getCode();
         Map<String, Object> verifyProcessDefinitionExists = 
processDefinitionService.verifyProcessDefinitionName(user, projectCode, name);
 
-        if (verifyProcessDefinitionExists.get(Constants.STATUS) != 
Status.SUCCESS) {
+        if (verifyProcessDefinitionExists.get(Constants.STATUS) == 
Status.PROCESS_DEFINITION_NAME_EXIST) {

Review comment:
       OK, I got you. 
   I suggest adding a log if the status is neither SUCCESS and 
PROCESS_DEFINITION_NAME_EXIST.
   This change is not mandatory, It's up to you.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to