mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Service and User API added, working with tests. Still need to polish the edges and add more tests.
This commit is contained in:
@@ -6,15 +6,12 @@ from app import db
|
||||
from app.models import User
|
||||
|
||||
|
||||
def create_user(email_address):
|
||||
user = User(email_address=email_address,
|
||||
created_at=datetime.now())
|
||||
db.session.add(user)
|
||||
def create_model_user(usr):
|
||||
db.session.add(usr)
|
||||
db.session.commit()
|
||||
return user.id
|
||||
|
||||
|
||||
def get_users(user_id=None):
|
||||
def get_model_users(user_id=None):
|
||||
if user_id:
|
||||
return User.query.filter_by(id=user_id).one()
|
||||
return User.query.filter_by().all()
|
||||
|
||||
Reference in New Issue
Block a user