diff --git a/src/authentic2/manager/forms.py b/src/authentic2/manager/forms.py index 05bd4469f..e131f6d98 100644 --- a/src/authentic2/manager/forms.py +++ b/src/authentic2/manager/forms.py @@ -737,31 +737,6 @@ class UserNewImportForm(UserImportForm): return new_import -class UserEditImportForm(UserImportForm): - def __init__(self, *args, **kwargs): - self.user_import = kwargs.pop('user_import') - initial = kwargs.setdefault('initial', {}) - initial['encoding'] = self.user_import.encoding - initial['ou'] = self.user_import.ou - super(UserEditImportForm, self).__init__(*args, **kwargs) - del self.fields['import_file'] - - def clean(self): - from authentic2.csv_import import CsvImporter - - encoding = self.cleaned_data['encoding'] - with self.user_import.import_file as fd: - importer = CsvImporter() - if not importer.run(fd, encoding): - self.raise_validation_error(importer.error.description or importer.error.code) - self.cleaned_data['rows_count'] = len(importer.rows) - - def save(self): - with self.user_import.meta_update as meta: - meta['ou'] = self.cleaned_data['ou'] - meta['encoding'] = self.cleaned_data['encoding'] - - class RolesCsvImportForm(LimitQuerysetFormMixin, forms.Form): import_file = forms.FileField( label=_('Roles file'), diff --git a/src/authentic2/manager/templates/authentic2/manager/user_import.html b/src/authentic2/manager/templates/authentic2/manager/user_import.html index c162b87ab..680aba4da 100644 --- a/src/authentic2/manager/templates/authentic2/manager/user_import.html +++ b/src/authentic2/manager/templates/authentic2/manager/user_import.html @@ -20,22 +20,21 @@ {% block sidebar %}