Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redudant db commit when getting serialised service #4337

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/serialised_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
from werkzeug.utils import cached_property

from app import db, redis_store
from app import redis_store
from app.dao.api_key_dao import get_model_api_keys
from app.dao.services_dao import dao_fetch_service_by_id

Expand Down Expand Up @@ -67,7 +67,6 @@ def get_dict(template_id, service_id, version):
)

template_dict = template_schema.dump(fetched_template)
db.session.commit()

return {"data": template_dict}

Expand Down Expand Up @@ -99,7 +98,6 @@ def get_dict(service_id):
from app.schemas import service_schema

service_dict = service_schema.dump(dao_fetch_service_by_id(service_id))
db.session.commit()

return {"data": service_dict}

Expand Down Expand Up @@ -127,5 +125,4 @@ def from_service_id(cls, service_id):
keys = [
{k: getattr(key, k) for k in SerialisedAPIKey.__annotations__} for key in get_model_api_keys(service_id)
]
db.session.commit()
return cls(keys)