summaryrefslogtreecommitdiffstats
path: root/accounts/backend/user/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/backend/user/__init__.py')
-rw-r--r--accounts/backend/user/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/accounts/backend/user/__init__.py b/accounts/backend/user/__init__.py
index 57ba952..e72302a 100644
--- a/accounts/backend/user/__init__.py
+++ b/accounts/backend/user/__init__.py
@@ -115,6 +115,7 @@ class Backend(object):
if account.password is None:
raise ValueError("Password required for register")
+ account.uidNumber = self._get_next_uidNumber()
self._store(account)
def update(self, account, as_admin=False):
@@ -134,3 +135,14 @@ class Backend(object):
Persists an account in the backend.
"""
raise NotImplementedError()
+
+ def _get_next_uidNumber(self):
+ """
+ Get the next free uid number.
+
+ During registration the backend need to assign a unique
+ uidNumber for each user. Most backends are unable to
+ automaticall increment a value. So this method is used by
+ register() to get the next free uid number in a safe way.
+ """
+ raise NotImplementedError()