Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
241d2462
Commit
241d2462
authored
Oct 27, 2017
by
Gabriel Detraz
Committed by
root
Oct 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Si l'instance ldap_user existe pas on l'ajoute sans bruit
parent
fd0cce6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
users/models.py
users/models.py
+5
-2
No files found.
users/models.py
View file @
241d2462
...
...
@@ -545,12 +545,16 @@ class User(AbstractBaseUser):
mail, password, shell, home
access_refresh : synchronise le dialup_access notant si l'user a accès
aux services
mac_refresh : synchronise les machines de l'user"""
mac_refresh : synchronise les machines de l'user
Si l'instance n'existe pas, on crée le ldapuser correspondant"""
self
.
refresh_from_db
()
try
:
user_ldap
=
LdapUser
.
objects
.
get
(
uidNumber
=
self
.
uid_number
)
except
LdapUser
.
DoesNotExist
:
user_ldap
=
LdapUser
(
uidNumber
=
self
.
uid_number
)
base
=
True
access_refresh
=
True
mac_refresh
=
True
if
base
:
user_ldap
.
name
=
self
.
pseudo
user_ldap
.
sn
=
self
.
pseudo
...
...
@@ -574,7 +578,6 @@ class User(AbstractBaseUser):
user_ldap
.
macs
=
[
str
(
mac
)
for
mac
in
Interface
.
objects
.
filter
(
machine__user
=
self
).
values_list
(
'mac_address'
,
flat
=
True
).
distinct
()]
user_ldap
.
save
()
def
ldap_del
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment