refactor user model and tests in authentication module
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
24d8edec19
commit
3afeed81b3
4 changed files with 48 additions and 60 deletions
|
|
@ -93,9 +93,7 @@ def registerUser(request):
|
|||
|
||||
Domain.objects.get(name=domain, open_registration=True)
|
||||
|
||||
user = ToolshedUser.objects.create_user(username, email, '', domain=domain)
|
||||
user.set_password(password)
|
||||
user.save()
|
||||
user = ToolshedUser.objects.create_user(username, email, password, domain=domain)
|
||||
return Response({'username': user.username, 'domain': user.domain})
|
||||
except Domain.DoesNotExist:
|
||||
return Response({'errors': {'domain': 'Domain does not exist or is not open for registration'}}, status=400)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue