[wip] Import users with a CSV

This commit is contained in:
ljf 2020-11-30 10:58:50 +01:00
parent b4570b81da
commit 2315e811fa
2 changed files with 28 additions and 0 deletions

View file

@ -206,6 +206,23 @@ user:
arguments:
username:
help: Username or email to get information
### user_import()
import:
action_help: Import several users from CSV
api: POST /users/import
arguments:
csv:
help: "CSV file with columns username, email, quota, groups(separated by coma) and optionally password"
type: open
-u:
full: --update
help: Update all existing users contained in the csv file (by default those users are ignored)
action: store_true
-d:
full: --delete
help: Delete all existing users that are not contained in the csv file (by default those users are ignored)
action: store_true
subcategories:
group:

View file

@ -566,6 +566,17 @@ def user_info(username):
return result_dict
def user_import(csv, update=False, delete=False):
"""
Import users from CSV
Keyword argument:
csv -- CSV file with columns username, email, quota, groups and optionnally password
"""
logger.warning(type(csv))
return {}
#
# Group subcategory
#