aboutsummaryrefslogtreecommitdiff
path: root/packet/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'packet/__init__.py')
-rw-r--r--packet/__init__.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/packet/__init__.py b/packet/__init__.py
index c7fed4b..82e2119 100644
--- a/packet/__init__.py
+++ b/packet/__init__.py
@@ -7,7 +7,7 @@ import logging
import os
import csh_ldap
-import onesignal
+import onesignal_sdk.client as onesignal
from flask import Flask
from flask_gzip import Gzip
from flask_migrate import Migrate
@@ -21,7 +21,7 @@ from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from .git import get_version
-app = Flask(__name__)
+app: Flask = Flask(__name__)
gzip = Gzip(app)
# Load default configuration and any environment variable overrides
@@ -38,7 +38,7 @@ app.config['VERSION'] = get_version()
# Logger configuration
logging.getLogger().setLevel(app.config['LOG_LEVEL'])
-app.logger.info('Launching packet v' + app.config['VERSION'])
+app.logger.info('Launching packet ' + app.config['VERSION'])
app.logger.info('Using the {} realm'.format(app.config['REALM']))
# Initialize the extensions
@@ -57,7 +57,7 @@ if app.config['ONESIGNAL_USER_AUTH_KEY'] and \
app.config['ONESIGNAL_CSH_APP_ID']:
csh_onesignal_client = onesignal.Client(
user_auth_key=app.config['ONESIGNAL_USER_AUTH_KEY'],
- app_auth_key=app.config['ONESIGNAL_CSH_APP_AUTH_KEY'],
+ rest_api_key=app.config['ONESIGNAL_CSH_APP_AUTH_KEY'],
app_id=app.config['ONESIGNAL_CSH_APP_ID']
)
app.logger.info('CSH Onesignal configured and notifications enabled')
@@ -68,7 +68,7 @@ if app.config['ONESIGNAL_USER_AUTH_KEY'] and \
app.config['ONESIGNAL_INTRO_APP_ID']:
intro_onesignal_client = onesignal.Client(
user_auth_key=app.config['ONESIGNAL_USER_AUTH_KEY'],
- app_auth_key=app.config['ONESIGNAL_INTRO_APP_AUTH_KEY'],
+ rest_api_key=app.config['ONESIGNAL_INTRO_APP_AUTH_KEY'],
app_id=app.config['ONESIGNAL_INTRO_APP_ID']
)
app.logger.info('Intro Onesignal configured and notifications enabled')
@@ -78,6 +78,7 @@ auth = OIDCAuthentication({'app': APP_CONFIG}, app)
app.logger.info('OIDCAuth configured')
# Sentry
+# pylint: disable=abstract-class-instantiated
sentry_sdk.init(
dsn=app.config['SENTRY_DSN'],
integrations=[FlaskIntegration(), SqlalchemyIntegration()]