.
This commit is contained in:
+4
-4
@@ -43,14 +43,14 @@ class UserUserFilter(django_filters.FilterSet):
|
|||||||
model = User
|
model = User
|
||||||
# fields = ("cid", "active", "internal_candidate", "group")
|
# fields = ("cid", "active", "internal_candidate", "group")
|
||||||
fields = {
|
fields = {
|
||||||
"first_name": ["contains"],
|
"first_name": ["icontains"],
|
||||||
"last_name": ["contains"],
|
"last_name": ["icontains"],
|
||||||
#"active": ["exact"],
|
#"active": ["exact"],
|
||||||
"user_groups": ["exact"],
|
"user_groups": ["exact"],
|
||||||
"user_groups__name": ["contains"],
|
"user_groups__name": ["icontains"],
|
||||||
#"userprofile__grade": ["exact"],
|
#"userprofile__grade": ["exact"],
|
||||||
#"userprofile__supervisor": ["exact"],
|
#"userprofile__supervisor": ["exact"],
|
||||||
"email": ["contains"],
|
"email": ["icontains"],
|
||||||
"is_active": ["exact"],
|
"is_active": ["exact"],
|
||||||
"groups": ["exact"],
|
"groups": ["exact"],
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -737,7 +737,7 @@ def accounts_bulk_create_check(request):
|
|||||||
errors.append("No email provided")
|
errors.append("No email provided")
|
||||||
|
|
||||||
if User.objects.filter(username=user["email"]).exists():
|
if User.objects.filter(username=user["email"]).exists():
|
||||||
info.append("User already exists")
|
errors.append("User already exists")
|
||||||
|
|
||||||
if not UserGrades.objects.filter(name=user["grade"]):
|
if not UserGrades.objects.filter(name=user["grade"]):
|
||||||
errors.append("Invalid grade")
|
errors.append("Invalid grade")
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
console.log("Existing users", data)
|
console.log("Existing users", data)
|
||||||
})
|
})
|
||||||
|
|
||||||
$("#users-list").append(`${users.length} users to create.`)
|
$("#users-list").append(`${users.length} users to create/update.`)
|
||||||
|
|
||||||
// Make sure the new hyperscript works
|
// Make sure the new hyperscript works
|
||||||
_hyperscript.processNode($("#users-list")[0]);
|
_hyperscript.processNode($("#users-list")[0]);
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
put "no errors" into #alert
|
put "No errors" into #alert
|
||||||
end
|
end
|
||||||
then show #alert
|
then show #alert
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user