mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 08:25:15 -05:00
Add queue name to service table.
Set queue name when creating the service
This commit is contained in:
@@ -84,7 +84,7 @@ class Service(db.Model):
|
||||
secondary=user_to_service,
|
||||
backref=db.backref('user_to_service', lazy='dynamic'))
|
||||
restricted = db.Column(db.Boolean, index=False, unique=False, nullable=False)
|
||||
|
||||
queue_name = db.Column(UUID(as_uuid=True))
|
||||
|
||||
class ApiKey(db.Model):
|
||||
__tablename__ = 'api_key'
|
||||
|
||||
@@ -28,6 +28,9 @@ def create_service():
|
||||
# I believe service is already added to the session but just needs a
|
||||
# db.session.commit
|
||||
try:
|
||||
# add service name to here or in dao?
|
||||
import uuid
|
||||
service.queue_name = uuid.uuid4()
|
||||
save_model_service(service)
|
||||
except DAOException as e:
|
||||
return jsonify(result="error", message=str(e)), 400
|
||||
|
||||
Reference in New Issue
Block a user