Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-LDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-LDAP
Commits
24a64251
Verified
Commit
24a64251
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Use tqdm for progress on interactive LDAP import
parent
a10e1319
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Resolve "Mass import of users"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/ldap/util/ldap_sync.py
+3
-2
3 additions, 2 deletions
aleksis/apps/ldap/util/ldap_sync.py
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
with
4 additions
and
2 deletions
aleksis/apps/ldap/util/ldap_sync.py
+
3
−
2
View file @
24a64251
...
...
@@ -9,6 +9,7 @@ from django.db.models import fields
from
django.utils.translation
import
gettext
as
_
from
constance
import
config
from
tqdm
import
tqdm
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -198,7 +199,7 @@ def ldap_sync_from_groups(group_infos):
# Resolve Group objects from LDAP group objects
group_objects
=
[]
for
ldap_group
in
group_infos
:
for
ldap_group
in
tqdm
(
group_infos
)
:
# Skip group if one of the name fields is missing
if
config
.
LDAP_GROUP_SYNC_FIELD_SHORT_NAME
not
in
ldap_group
[
1
]:
logger
.
error
(
"
LDAP group with DN %s does not have field %s
"
%
(
...
...
@@ -273,7 +274,7 @@ def mass_ldap_import():
# Synchronise user data for all found users
ldap_users
=
backend
.
settings
.
USER_SEARCH
.
execute
(
connection
,
{
"
user
"
:
"
*
"
},
escape
=
False
)
for
dn
,
attrs
in
ldap_users
:
for
dn
,
attrs
in
tqdm
(
ldap_users
)
:
uid
=
attrs
[
uid_field
][
0
]
# Prepare an empty LDAPUser object with the target username
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
0
View file @
24a64251
...
...
@@ -21,6 +21,7 @@ classifiers = [
[tool.poetry.dependencies]
python
=
"^3.7"
django-ldapdb
=
"^1.4.0"
tqdm
=
"^4.44.1"
AlekSIS
=
{
path
=
"../../.."
}
[build-system]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment