Deactivated users are supported

This commit is contained in:
Nicolas Vanvyve 2019-12-23 11:46:30 +01:00
parent 0ed3cd8e5b
commit 7f6a680985
3 changed files with 5 additions and 6 deletions

2
.gitignore vendored
View file

@ -11,4 +11,4 @@ build
.vscode .vscode
.env .env
.pytest_cache .pytest_cache
.idea/

View file

@ -89,7 +89,6 @@
{% include "display_errors.html" %} {% include "display_errors.html" %}
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
{{ form.file }} {{ form.file }}
{{ form.csrf_token() }}
<div class="actions"> <div class="actions">
<button class="btn btn-primary">{{ _("Import") }}</button> <button class="btn btn-primary">{{ _("Import") }}</button>
</div> </div>

View file

@ -418,16 +418,16 @@ def upload_json():
def import_project(file): def import_project(file):
# From json : export list of members # From json : export list of members
json_file = json.load(open(file)) json_file = json.load(open(file))
members = get_members(json_file) members_json = get_members(json_file)
active_members = g.project.active_members members = g.project.members
members_already_here = list() members_already_here = list()
for m in active_members: for m in members:
members_already_here.append(str(m)) members_already_here.append(str(m))
# List all members not in the project and weight associated # List all members not in the project and weight associated
# List of tuples (name,weight) # List of tuples (name,weight)
members_to_add = list() members_to_add = list()
for i in members: for i in members_json:
if str(i[0]) not in members_already_here: if str(i[0]) not in members_already_here:
members_to_add.append(i) members_to_add.append(i)