Skip to content

Commit

Permalink
Don't rais an error if duplicated identity name (#2191)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmahmouali committed Jan 12, 2021
1 parent e21c53e commit d0da777
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions jumpscale/packages/threebot_deployer/chats/threebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,21 @@ def get_solution_name(self):

threebot_solutions = list_threebot_solutions(self.solution_metadata["owner"])
threebot_solutions_names = [threebot["name"] for threebot in threebot_solutions]
self.solution_name = self.string_ask(
self.CREATE_NAME_MESSAGE,
required=True,
field="name",
is_identifier=True,
not_exist=["3Bot", threebot_solutions_names],
)
if self._existing_3bot():
self.stop(
f"The specified 3Bot name was deployed before. Please go to the previous step and enter a new name."
not_valid_name = True
while not_valid_name:
self.solution_name = self.string_ask(
self.CREATE_NAME_MESSAGE,
required=True,
field="name",
is_identifier=True,
not_exist=["3Bot", threebot_solutions_names],
)
if self._existing_3bot():
self.md_show(
f"The specified 3Bot name was deployed before. Please go to the previous step and enter a new name."
)
else:
not_valid_name = False

self.backup_model = BACKUP_MODEL_FACTORY.get(f"{self.solution_name}_{self.threebot_name}")

Expand Down

0 comments on commit d0da777

Please sign in to comment.