Fix for !alts add with non-existing character
This commit is contained in:
@@ -69,7 +69,7 @@ class AltsController:
|
||||
main = self.account_service.get_main(request.sender.char_id)
|
||||
for alt in alt_chars:
|
||||
if not alt.char_id:
|
||||
notfound.append(alt)
|
||||
notfound.append(alt.name if type(alt) == SenderObj else alt)
|
||||
continue
|
||||
if main.char_id == alt.char_id:
|
||||
failed.append(self.getresp("module/alts", "add_fail_self"))
|
||||
@@ -86,9 +86,9 @@ class AltsController:
|
||||
reply += self.getresp("module/alts", "add_success_self",
|
||||
{"char": ", ".join(done)})
|
||||
if len(notfound) > 0:
|
||||
reply += "\n" + self.getresp("global", "char_not_found", {"char": ", ".join(notfound)})
|
||||
reply += "\n" if reply != "" else '' + self.getresp("global", "char_not_found", {"char": ", ".join(notfound)})
|
||||
if len(gotalts) > 0:
|
||||
reply += "\n" + self.getresp("module/alts", "add_fail_already", {"char": ", ".join(gotalts)})
|
||||
reply += "\n" if reply != "" else '' + self.getresp("module/alts", "add_fail_already", {"char": ", ".join(gotalts)})
|
||||
reply += "\n".join(failed)
|
||||
return reply
|
||||
|
||||
|
||||
Reference in New Issue
Block a user