mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-04-08 19:34:13 +00:00
fix
This commit is contained in:
parent
1096da7e0b
commit
813f8bd55b
@ -602,7 +602,12 @@ class LollmsApplication(LoLLMsCom):
|
||||
def del_personality_language(self, language:str):
|
||||
if language is None or language == "":
|
||||
return False
|
||||
|
||||
language = language.lower().strip().split()[0]
|
||||
default_language = self.personality.language.lower().strip().split()[0]
|
||||
if language == default_language:
|
||||
return False # Can't remove the default language
|
||||
|
||||
language_path = self.lollms_paths.personal_configuration_path/"personalities"/self.personality.name/f"languages_{language}.yaml"
|
||||
if language_path.exists():
|
||||
try:
|
||||
|
@ -301,6 +301,12 @@ def del_personality_language(request: SetLanguageRequest):
|
||||
# Access verification
|
||||
check_access(lollmsElfServer, request.client_id)
|
||||
sanitize_path(request.language)
|
||||
language = request.language.lower().strip().split()[0]
|
||||
default_language = lollmsElfServer.personality.language.lower().strip().split()[0]
|
||||
|
||||
if language==default_language:
|
||||
lollmsElfServer.InfoMessage("It is not possible to delete the default language of a personality")
|
||||
return
|
||||
# Calling the method to set the personality language
|
||||
if lollmsElfServer.config.turn_on_language_validation:
|
||||
if not show_yes_no_dialog("Language deletion request received","I have received a language deletion request. Are you sure?"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user