Skip to content

Commit

Permalink
Fix message endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
brngylni committed Jul 24, 2024
1 parent 3cda15b commit 5ccdf8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ classifiers = [
python = "^3.11"
sqlalchemy-helpers = ">=0.12.1"
flask = "^3.0.3"

gunicorn = {version = "^22.0.0", optional = true}

webhook-to-fedora-messaging-messages = "^1.0.0"
fasjson-client = "^1.0.8"
gunicorn = {version = "^22.0.0", optional = true}


[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion webhook_to_fedora_messaging/endpoints/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_msg(service_uuid):
"""

try:
service = db.session.scalar(select(Service).where(Service.uuid == service_uuid)).one()
service = db.session.execute(select(Service).where(Service.uuid == service_uuid)).scalar_one()
except NoResultFound:
return {'message': 'Service UUID Not Found'}, 404

Expand Down
5 changes: 2 additions & 3 deletions webhook_to_fedora_messaging/endpoints/parser/github.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from flask import request
from flask import request, current_app
import hashlib
import hmac
from webhook_to_fedora_messaging_messages.github.github import GithubMessageV1
from webhook_to_fedora_messaging.exceptions import SignatureMatchError
import fasjson_client
from webhook_to_fedora_messaging.config.defaults import FASJSON_URL


def github_parser(secret: str) -> GithubMessageV1:
Expand Down Expand Up @@ -47,7 +46,7 @@ def fas_by_github(username: str) -> str:
Args:
username: Github Username"""

fasjson = fasjson_client.Client(FASJSON_URL)
fasjson = fasjson_client.Client(current_app.config["FASJSON_URL"])
response = fasjson.search(github_username=username)
if response.result and len(response.result) == 1:
return response.result[0]["username"]
Expand Down

0 comments on commit 5ccdf8f

Please sign in to comment.