Commit f32e1e5b authored by Pelayo Torres's avatar Pelayo Torres
Browse files

Fix enhanced events

parent 9c1640e1
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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

+1 −1
Original line number Diff line number Diff line
@@ -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)