mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
config/user question: raise an error if no user exists yet
This commit is contained in:
parent
47db3e798e
commit
62ebd68e34
1 changed files with 8 additions and 0 deletions
|
@ -815,6 +815,14 @@ class UserQuestion(Question):
|
||||||
|
|
||||||
super().__init__(question, user_answers)
|
super().__init__(question, user_answers)
|
||||||
self.choices = user_list()["users"]
|
self.choices = user_list()["users"]
|
||||||
|
|
||||||
|
if not self.choices:
|
||||||
|
raise YunohostValidationError(
|
||||||
|
"app_argument_invalid",
|
||||||
|
name=self.name,
|
||||||
|
error="You should create a YunoHost user first."
|
||||||
|
)
|
||||||
|
|
||||||
if self.default is None:
|
if self.default is None:
|
||||||
root_mail = "root@%s" % _get_maindomain()
|
root_mail = "root@%s" % _get_maindomain()
|
||||||
for user in self.choices.keys():
|
for user in self.choices.keys():
|
||||||
|
|
Loading…
Add table
Reference in a new issue