mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Python3 migration for export user feature
This commit is contained in:
parent
a78e4c8eac
commit
1d33f333cd
1 changed files with 3 additions and 3 deletions
|
@ -616,8 +616,8 @@ def user_export():
|
|||
|
||||
"""
|
||||
import csv # CSV are needed only in this function
|
||||
from io import BytesIO
|
||||
with BytesIO() as csv_io:
|
||||
from io import StringIO
|
||||
with StringIO() as csv_io:
|
||||
writer = csv.DictWriter(csv_io, CSV_FIELDNAMES,
|
||||
delimiter=';', quotechar='"')
|
||||
writer.writeheader()
|
||||
|
@ -677,7 +677,7 @@ def user_import(operation_logger, csvfile, update=False, delete=False):
|
|||
format_errors = [key + ':' + str(user[key])
|
||||
for key, validator in VALIDATORS.items()
|
||||
if user[key] is None or not re.match(validator, user[key])]
|
||||
except KeyError, e:
|
||||
except KeyError as e:
|
||||
logger.error(m18n.n('user_import_missing_column',
|
||||
column=str(e)))
|
||||
is_well_formatted = False
|
||||
|
|
Loading…
Add table
Reference in a new issue