mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[wip] Import users with a CSV
This commit is contained in:
parent
b4570b81da
commit
2315e811fa
2 changed files with 28 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue