diff --git a/orchestra/contrib/saas/backends/moodle.py b/orchestra/contrib/saas/backends/moodle.py index b4d28477..cdda0d92 100644 --- a/orchestra/contrib/saas/backends/moodle.py +++ b/orchestra/contrib/saas/backends/moodle.py @@ -60,6 +60,7 @@ class MoodleMuBackend(ServiceController): chown %(user)s:%(user)s %(moodledata_path)s export SITE=%(site_name)s CHANGE_PASSWORD=0 + # TODO su moodle user php %(moodle_path)s/admin/cli/install_database.php \\ --fullname="%(site_name)s" \\ --shortname="%(site_name)s" \\ diff --git a/orchestra/contrib/systemusers/actions.py b/orchestra/contrib/systemusers/actions.py index 8cefff51..24194ae1 100644 --- a/orchestra/contrib/systemusers/actions.py +++ b/orchestra/contrib/systemusers/actions.py @@ -96,7 +96,8 @@ def create_link(modeladmin, request, queryset): base_home = cleaned_data['base_home'] extension = cleaned_data['home_extension'] target = os.path.join(base_home, extension) - link_name = cleaned_data['link_name'] or os.path.join(user.home, os.path.basename(target)) + default_name = os.path.join(user.home, os.path.basename(target)) + link_name = cleaned_data['link_name'] or default_name user.create_link_target = target user.create_link_name = link_name operations.extend(Operation.create_for_action(user, 'create_link')) diff --git a/orchestra/contrib/systemusers/forms.py b/orchestra/contrib/systemusers/forms.py index c2bced5c..c15a9f75 100644 --- a/orchestra/contrib/systemusers/forms.py +++ b/orchestra/contrib/systemusers/forms.py @@ -93,7 +93,8 @@ class LinkForm(forms.Form): base_home = forms.ChoiceField(label=_("Target path"), choices=(), help_text=_("Target link will be under this directory.")) home_extension = forms.CharField(label=_("Home extension"), required=False, initial='', - widget=forms.TextInput(attrs={'size':'70'}), help_text=_("Relative to chosen home.")) + widget=forms.TextInput(attrs={'size':'70'}), + help_text=_("Relative path to chosen directory.")) link_name = forms.CharField(label=_("Link name"), required=False, initial='', widget=forms.TextInput(attrs={'size':'70'}), help_text=_("If left blank or relative path: link will be created in each user home.")) @@ -119,10 +120,12 @@ class LinkForm(forms.Form): if link_name: if link_name.startswith('/'): if len(self.queryset) > 1: - raise ValidationError(_("Link name can not be a full path when multiple users.")) + raise ValidationError( + _("Link name can not be a full path when multiple users.")) link_names = [os.path.dirname(link_name)] else: - link_names = [os.path.join(user.home, os.path.dirname(link_names)) for user in self.queryset] + dir_name = os.path.dirname(link_name) + link_names = [os.path.join(user.home, dir_name) for user in self.queryset] validate_paths_exist(self.instance, link_names) return link_name diff --git a/orchestra/contrib/systemusers/templates/admin/systemusers/systemuser/create_link.html b/orchestra/contrib/systemusers/templates/admin/systemusers/systemuser/create_link.html index 70816c4f..7fb44bc3 100644 --- a/orchestra/contrib/systemusers/templates/admin/systemusers/systemuser/create_link.html +++ b/orchestra/contrib/systemusers/templates/admin/systemusers/systemuser/create_link.html @@ -30,7 +30,7 @@