mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
109898688: All codes are valid until one code is used, then they are all marked used.
Fixed the is_active() method on the Users model, if the user was pending they would come back as active, allowing a user to sign in before being active. There is still a problem with the validate_sms_code and validate_email_code method.
This commit is contained in:
@@ -4,13 +4,25 @@ from app.main.dao import users_dao
|
||||
from app.models import User
|
||||
|
||||
|
||||
def create_test_user():
|
||||
def create_test_user(state):
|
||||
user = User(name='Test User',
|
||||
password='somepassword',
|
||||
email_address='test@user.gov.uk',
|
||||
mobile_number='+441234123412',
|
||||
created_at=datetime.now(),
|
||||
role_id=1,
|
||||
state='pending')
|
||||
state=state)
|
||||
users_dao.insert_user(user)
|
||||
return user
|
||||
|
||||
|
||||
def create_another_test_user(state):
|
||||
user = User(name='Another Test User',
|
||||
password='someOtherpassword',
|
||||
email_address='another_test@user.gov.uk',
|
||||
mobile_number='+442233123412',
|
||||
created_at=datetime.now(),
|
||||
role_id=1,
|
||||
state=state)
|
||||
users_dao.insert_user(user)
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user