diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 84a0d9a5..1d6b1e35 100755 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -2758,11 +2758,14 @@ class AppBase: if destinationvalue.lower() in sourcevalue.lower(): return True - elif check.lower() == "is empty": - if len(sourcevalue) == 0: - return True + elif check.lower() == "is empty" or check.lower() == "is_empty": + try: + if len(list(sourcevalue)) == 0: + return True + except Exception as e: + self.logger.info(f"[WARNING] Failed to check if empty as list: {e}") - if str(sourcevalue) == 0: + if len(str(sourcevalue)) == 0: return True return False @@ -2784,15 +2787,41 @@ class AppBase: return False elif check.lower() == "larger than" or check.lower() == "bigger than": + try: + destinationvalue = len(list(destinationvalue)) + except Exception as e: + self.logger.info(f"[WARNING] Failed to convert destination to list: {e}") + + try: + # Check if it's a list in autocast and if so, check the length + if len(list(sourcevalue)) > int(destinationvalue): + return True + except Exception as e: + self.logger.info(f"[WARNING] Failed to check if larger than as list: {e}") + try: if str(sourcevalue).isdigit() and str(destinationvalue).isdigit(): if int(sourcevalue) > int(destinationvalue): return True except AttributeError as e: - print("[WARNING] Condition larger than failed with values %s and %s: %s" % (sourcevalue, destinationvalue, e)) + self.logger.info("[WARNING] Condition larger than failed with values %s and %s: %s" % (sourcevalue, destinationvalue, e)) return False + + elif check.lower() == "smaller than" or check.lower() == "less than": + try: + destinationvalue = len(list(destinationvalue)) + except Exception as e: + self.logger.info(f"[WARNING] Failed to convert destination to list: {e}") + + + try: + # Check if it's a list in autocast and if so, check the length + if len(list(sourcevalue)) < int(destinationvalue): + return True + except Exception as e: + self.logger.info(f"[WARNING] Failed to check if smaller than as list: {e}") try: if str(sourcevalue).isdigit() and str(destinationvalue).isdigit(): if int(sourcevalue) < int(destinationvalue): @@ -2801,6 +2830,7 @@ class AppBase: except AttributeError as e: print("[WARNING] Condition smaller than failed with values %s and %s: %s" % (sourcevalue, destinationvalue, e)) return False + elif check.lower() == "re" or check.lower() == "matches regex": try: found = re.search(str(destinationvalue), str(sourcevalue)) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 3d1a7b71..7f561852 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -3577,7 +3577,6 @@ func runInitEs(ctx context.Context) { if len(activeOrgs) == 0 { time.Sleep(10 * time.Second) activeOrgs, err = shuffle.GetAllOrgs(ctx) - return } setUsers := false