|
50 | 50 | app.config['OIDC_CLIENT_SECRET']))
|
51 | 51 |
|
52 | 52 | # Initialize Onesignal Notification apps
|
53 |
| -csh_onesignal_client = onesignal.Client(user_auth_key=app.config['ONESIGNAL_USER_AUTH_KEY'], |
54 |
| - app_auth_key=app.config['ONESIGNAL_CSH_APP_AUTH_KEY'], |
55 |
| - app_id=app.config['ONESIGNAL_CSH_APP_ID']) |
56 |
| - |
57 |
| -intro_onesignal_client = onesignal.Client(user_auth_key=app.config['ONESIGNAL_USER_AUTH_KEY'], |
58 |
| - app_auth_key=app.config['ONESIGNAL_INTRO_APP_AUTH_KEY'], |
59 |
| - app_id=app.config['ONESIGNAL_INTRO_APP_ID']) |
| 53 | +csh_onesignal_client = None |
| 54 | +if app.config['ONESIGNAL_USER_AUTH_KEY'] and \ |
| 55 | + app.config['ONESIGNAL_CSH_APP_AUTH_KEY'] and \ |
| 56 | + app.config['ONESIGNAL_CSH_APP_ID']: |
| 57 | + csh_onesignal_client = onesignal.Client( |
| 58 | + user_auth_key=app.config['ONESIGNAL_USER_AUTH_KEY'], |
| 59 | + app_auth_key=app.config['ONESIGNAL_CSH_APP_AUTH_KEY'], |
| 60 | + app_id=app.config['ONESIGNAL_CSH_APP_ID'] |
| 61 | + ) |
| 62 | + app.logger.info('CSH Onesignal configured and notifications enabled') |
| 63 | + |
| 64 | +intro_onesignal_client = None |
| 65 | +if app.config['ONESIGNAL_USER_AUTH_KEY'] and \ |
| 66 | + app.config['ONESIGNAL_INTRO_APP_AUTH_KEY'] and \ |
| 67 | + app.config['ONESIGNAL_INTRO_APP_ID']: |
| 68 | + intro_onesignal_client = onesignal.Client( |
| 69 | + user_auth_key=app.config['ONESIGNAL_USER_AUTH_KEY'], |
| 70 | + app_auth_key=app.config['ONESIGNAL_INTRO_APP_AUTH_KEY'], |
| 71 | + app_id=app.config['ONESIGNAL_INTRO_APP_ID'] |
| 72 | + ) |
| 73 | + app.logger.info('Intro Onesignal configured and notifications enabled') |
60 | 74 |
|
61 | 75 | # OIDC Auth
|
62 | 76 | auth = OIDCAuthentication({'app': APP_CONFIG}, app)
|
63 |
| - |
64 |
| -# LDAP |
65 |
| -_ldap = csh_ldap.CSHLDAP(app.config['LDAP_BIND_DN'], app.config['LDAP_BIND_PASS']) |
| 77 | +app.logger.info('OIDCAuth configured') |
66 | 78 |
|
67 | 79 | # Sentry
|
68 | 80 | sentry_sdk.init(
|
69 | 81 | dsn=app.config['SENTRY_DSN'],
|
70 | 82 | integrations=[FlaskIntegration(), SqlalchemyIntegration()]
|
71 | 83 | )
|
72 | 84 |
|
73 |
| -app.logger.info('OIDCAuth and LDAP configured') |
74 | 85 |
|
75 | 86 | # pylint: disable=wrong-import-position
|
| 87 | +from .ldap import ldap |
76 | 88 | from . import models
|
77 | 89 | from . import context_processors
|
78 | 90 | from . import commands
|
|
0 commit comments