mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
When handling the complaint we don't want to throw an exception if the message is missing fields. Only log an exception if we are unable to tie a complaint to a notification.
13 lines
287 B
Python
13 lines
287 B
Python
from app import db
|
|
from app.dao.dao_utils import transactional
|
|
from app.models import Complaint
|
|
|
|
|
|
@transactional
|
|
def save_complaint(complaint):
|
|
db.session.add(complaint)
|
|
|
|
|
|
def fetch_complaints_by_service(service_id):
|
|
return Complaint.query.filter_by(service_id=service_id).all()
|