Skip to content
Snippets Groups Projects
Commit f32e1e5b authored by torrespel's avatar torrespel
Browse files

Fix enhanced events

parent 9c1640e1
No related branches found
No related tags found
2 merge requests!99Merge Latest changes from staging to main,!78Fix enhanced events
Pipeline #10325 passed
......@@ -14,6 +14,7 @@ from .responses import internal_server_error, not_found_error, make_response, ba
from ..db.db import MongoDatabse
from ..util import serialize_clean_camel_case, clean_empty, dict_to_camel_case
from .auth_manager import AuthManager
import os
class EventSubscriptionsOperations(Resource):
......@@ -75,8 +76,7 @@ class EventSubscriptionsOperations(Resource):
self.auth_manager.add_auth_event(subscription_id, subscriber_id)
res = make_response(object=serialize_clean_camel_case(event_subscription), status=201)
res.headers['Location'] = "http://localhost:8080/capif-events/v1/" + \
str(subscriber_id) + "/subscriptions/" + str(subscription_id)
res.headers['Location'] = f"http://{os.getenv("CAPIF_HOSTNAME")}/capif-events/v1/{str(subscriber_id)}/subscriptions/{str(subscription_id)}"
return res
......
......@@ -40,7 +40,7 @@ class Notifications():
if not (key == "serviceAPIDescriptions" and redis_event.get('event', None) in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"]):
event_detail[key]=redis_event.get('information', None)[pos]
else:
if not (redis_event.get('event', None) in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"] and key == "serviceAPIDescriptions" and not EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]):
if not (redis_event.get('event', None) in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"] and key == "serviceAPIDescriptions" and (not EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"] or not EventSubscription.return_supp_feat_dict(sub["supported_features"])["EnhancedEventReport"])):
event_detail[key]=redis_event.get('information', None)[pos]
current_app.logger.debug(event_detail)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment