Skip to content

Commit

Permalink
OM-128 Removed some config
Browse files Browse the repository at this point in the history
  • Loading branch information
malinowskikam committed Mar 1, 2024
1 parent 55d81e7 commit 06ecf55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
14 changes: 4 additions & 10 deletions msystems/apps.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from django.apps import AppConfig

DEFAULT_CFG = {
# Requires mpass_config and mpass_login_redirect to be filled correctly
'enable_mpass': False,
# Requires wsgi server, wont work on development server
'enable_mpay': True,
# URL to be redirected to after successful login
'mpass_login_redirect': "",
# Mpass configurations
Expand Down Expand Up @@ -66,10 +62,10 @@
'mpay_cert': "",
# Default account info for voucher payments
'mpay_destination_account': {
'BankCode': "Code",
'BankFiscalCode': "FiscalCode",
'BankAccount': "Account",
'BeneficiaryName': "Beneficiary"
'BankCode': "",
'BankFiscalCode': "",
'BankAccount': "",
'BeneficiaryName': ""
}
}
}
Expand All @@ -87,11 +83,9 @@ class MsystemsConfig(AppConfig):
ENROLMENT_OFFICER = 'Enrolment Officer'
##### ------------------ ####

enable_mpass = False
mpass_config = None
mpass_login_redirect = None

enable_mpay = False
mpay_config = None

def ready(self):
Expand Down
12 changes: 4 additions & 8 deletions msystems/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.urls import path, include
from django.views.decorators.csrf import csrf_exempt

from msystems.apps import MsystemsConfig
from msystems.views import mpass, mpay

saml_urls = [
Expand All @@ -11,10 +10,7 @@
path("acs/", mpass.acs),
]

urlpatterns = []

if MsystemsConfig.enable_mpass:
urlpatterns += [path("saml/", include(saml_urls))]

if MsystemsConfig.enable_mpay:
urlpatterns += [path("mpay/", csrf_exempt(mpay.mpay_app))]
urlpatterns = [
path("saml/", include(saml_urls)),
path("mpay/", csrf_exempt(mpay.mpay_app))
]

0 comments on commit 06ecf55

Please sign in to comment.