wrap UserManager.create_user in a transaction
This commit is contained in:
parent
11baf6bace
commit
6984033444
1 changed files with 2 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
from datetime import date
|
||||
import os
|
||||
|
||||
from django.db import models
|
||||
from django.db import models, transaction
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils import timezone
|
||||
|
@ -176,6 +176,7 @@ class UserManager(models.Manager):
|
|||
break
|
||||
return nextuser
|
||||
|
||||
@transaction.atomic
|
||||
def create_user(self, username=None, password=None, commit=False):
|
||||
uid = self.get_next_uid()
|
||||
gid = Group.objects.get_next_gid()
|
||||
|
|
Loading…
Reference in a new issue