mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 07:56:50 +00:00
feature get consumer key from settings for direct login
This commit is contained in:
parent
d74836200d
commit
87aee60412
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,4 +5,5 @@ apimanager/apimanager/local_settings.py
|
||||
.idea
|
||||
API-Manager.iml
|
||||
apimanager/.DS_Store
|
||||
venv
|
||||
venv
|
||||
.env
|
||||
1
apimanager/.env
Normal file
1
apimanager/.env
Normal file
@ -0,0 +1 @@
|
||||
OAUTH_CONSUMER_KEY = dmi4bhpdjtsjka5ed5a32wawitwwfftm4xoiksnu
|
||||
@ -29,6 +29,7 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
choices=[],
|
||||
)
|
||||
|
||||
name = forms.CharField(
|
||||
label='Name',
|
||||
widget=forms.TextInput(
|
||||
@ -39,6 +40,7 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=True
|
||||
)
|
||||
|
||||
address = forms.CharField(
|
||||
label='Address',
|
||||
widget=forms.Textarea(
|
||||
@ -103,16 +105,7 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
"""drive_up = forms.CharField(
|
||||
label='Drive Up',
|
||||
widget=forms.Textarea(
|
||||
attrs={
|
||||
'placeholder': 'None', # noqa
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)"""
|
||||
|
||||
located_at = forms.CharField(
|
||||
label='ATM location',
|
||||
widget=forms.TextInput(
|
||||
@ -123,6 +116,7 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
is_accessible = forms.ChoiceField(
|
||||
label='is accessible',
|
||||
widget=forms.Select(
|
||||
@ -132,6 +126,7 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
accessibleFeatures = forms.CharField(
|
||||
label='Accessible Features',
|
||||
widget=forms.TextInput(
|
||||
@ -142,6 +137,7 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
services = forms.CharField(
|
||||
label='Services',
|
||||
widget=forms.TextInput(
|
||||
@ -152,6 +148,7 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
more_info = forms.CharField(
|
||||
label='More information',
|
||||
widget=forms.TextInput(
|
||||
@ -172,24 +169,27 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
notes = forms.ChoiceField(
|
||||
label='Write Notes',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
label='Write Notes',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
location_categories = forms.ChoiceField(
|
||||
label='Write location Category',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
label='Write location Category',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
minimum_withdrawal = forms.CharField(
|
||||
label='Minimum Withdrawal',
|
||||
widget=forms.TextInput(
|
||||
@ -200,97 +200,103 @@ class CreateAtmForm(forms.Form):
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
site_name = forms.CharField(
|
||||
label='Site Name',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Enter your Site Name ',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
label='Site Name',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Enter your Site Name ',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
branch_identification = forms.CharField(
|
||||
label='Branch Identification',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Enter your Branch Identification',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
label='Branch Identification',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Enter your Branch Identification',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
site_identification = forms.CharField(
|
||||
label='Site Identification',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Enter your Site Identification',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
label='Site Identification',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Enter your Site Identification',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
services = forms.CharField(
|
||||
label='Services',
|
||||
widget=forms.TextInput(
|
||||
label='Services',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Services Are',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
supported_languages = forms.ChoiceField(
|
||||
label='supported_languages',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
has_deposit_capability = forms.ChoiceField(
|
||||
label='Deposit Capabilities',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
cash_withdrawal_national_fee = forms.CharField(
|
||||
label='Cash Withdrawal National fee',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Cash withdrawal national fee',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
cash_withdrawal_international_fee = forms.CharField(
|
||||
label='Cash Withdrawal international fee',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Cash withdrawal international fee',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
balance_inquiry_fee = forms.CharField(
|
||||
label='Balance Inquiry Fee',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Balance Inquiry Fee',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
label='supported_languages',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
has_deposit_capability = forms.ChoiceField(
|
||||
label='Deposit Capabilities',
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
cash_withdrawal_national_fee = forms.CharField(
|
||||
label='Cash Withdrawal National fee',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Cash withdrawal national fee',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
cash_withdrawal_international_fee = forms.CharField(
|
||||
label='Cash Withdrawal international fee',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Cash withdrawal international fee',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
balance_inquiry_fee = forms.CharField(
|
||||
label='Balance Inquiry Fee',
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
'placeholder': 'Balance Inquiry Fee',
|
||||
'class': 'form-control',
|
||||
}
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
kwargs.setdefault('label_suffix', '')
|
||||
|
||||
@ -173,118 +173,114 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4"> {% if form.cash_withdrawal_national_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.cash_withdrawal_national_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">{{ form.cash_withdrawal_national_fee.label_tag }} {{ form.cash_withdrawal_national_fee }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.balance_inquiry_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.balance_inquiry_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.balance_inquiry_fee.label_tag }} {{ form.balance_inquiry_fee }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.cash_withdrawal_international_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.cash_withdrawal_international_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.cash_withdrawal_international_fee.label_tag }} {{ form.cash_withdrawal_international_fee }}
|
||||
</div>
|
||||
<div class="alert alert-danger">{{ form.cash_withdrawal_national_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">{{ form.cash_withdrawal_national_fee.label_tag }} {{ form.cash_withdrawal_national_fee }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
{% if form.address.errors %}
|
||||
<div class="alert alert-danger">{{ form.address.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.address.label_tag }} {{ form.address }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
{% if form.lobby.errors %}
|
||||
<div class="alert alert-danger">{{ form.lobby.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.lobby.label_tag }} {{ form.lobby }}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.balance_inquiry_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.balance_inquiry_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.balance_inquiry_fee.label_tag }} {{ form.balance_inquiry_fee }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.cash_withdrawal_international_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.cash_withdrawal_international_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.cash_withdrawal_international_fee.label_tag }} {{ form.cash_withdrawal_international_fee }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
{% if form.address.errors %}
|
||||
<div class="alert alert-danger">{{ form.address.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.address.label_tag }} {{ form.address }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
{% if form.lobby.errors %}
|
||||
<div class="alert alert-danger">{{ form.lobby.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.lobby.label_tag }} {{ form.lobby }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 hidden-xs">
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-green">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover tablesorter" id="atms-list" aria-describedby="atms list">
|
||||
<thead>
|
||||
<th scope="col">ATM Id</th>
|
||||
<th scope="col">Bank Id</th>
|
||||
<th scope="col">ATM Name</th>
|
||||
<th scope="col">More_info</th>
|
||||
<th scope="col">Update Button</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for atm in atms_list %} {% url 'atms_update' atm.id atm.bank_id as url_atm_update %}
|
||||
<tr data-atm-id="{{ branch.id }}">
|
||||
<td>{{ atm.id }}</td>
|
||||
<td>{{ atm.bank_id }}</td>
|
||||
<td>{{ atm.name }}</td>
|
||||
<td>
|
||||
<div class="popuptext">
|
||||
<ul>
|
||||
<li>Address:
|
||||
<ul>
|
||||
<li>line1: {{atm.address.line_1}}</li>
|
||||
<li>line2: {{atm.address.line_2}}</li>
|
||||
<li>line3: {{atm.address.line_3}}</li>
|
||||
<li>city: {{atm.address.city}}</li>
|
||||
<li>county: {{atm.address.county}}</li>
|
||||
<li>state: {{atm.address.state}}</li>
|
||||
<li>postcode: {{atm.address.postcode}}</li>
|
||||
<li>country_code: {{atm.address.country_code}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Location:
|
||||
<ul>
|
||||
<li>latitude: {{atm.location.latitude}}</li>
|
||||
<li>longitude: {{atm.location.longitude}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Meta License:
|
||||
<ul>
|
||||
<li>id: {{atm.meta.license.id}}</li>
|
||||
<li>name: {{atm.meta.license.name}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Routing
|
||||
<ul>
|
||||
<li>Scheme: {{atm.atm_routing.scheme}}</li>
|
||||
<li>Address: {{atm.atm_routing.address}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Type: {{atm.branch_type}}</li>
|
||||
<li>More Info: {{atm.more_info}}</li>
|
||||
<!-- <li>Phone Number: {{atm.phone_number}}</li>-->
|
||||
<li>Accessible Features: {{atm.accessibleFeatures}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><a href="{{ url_branch_update }}" class="btn btn-primary">Update</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 hidden-xs">
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-green">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover tablesorter" id="atms-list" aria-describedby="atms list">
|
||||
<thead>
|
||||
<th scope="col">ATM Id</th>
|
||||
<th scope="col">Bank Id</th>
|
||||
<th scope="col">ATM Name</th>
|
||||
<th scope="col">More_info</th>
|
||||
<th scope="col">Update Button</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for atm in atms_list %} {% url 'atms_update' atm.id atm.bank_id as url_atm_update %}
|
||||
<tr data-atm-id="{{ branch.id }}">
|
||||
<td>{{ atm.id }}</td>
|
||||
<td>{{ atm.bank_id }}</td>
|
||||
<td>{{ atm.name }}</td>
|
||||
<td>
|
||||
<div class="popuptext">
|
||||
<ul>
|
||||
<li>Address:
|
||||
<ul>
|
||||
<li>line1: {{atm.address.line_1}}</li>
|
||||
<li>line2: {{atm.address.line_2}}</li>
|
||||
<li>line3: {{atm.address.line_3}}</li>
|
||||
<li>city: {{atm.address.city}}</li>
|
||||
<li>county: {{atm.address.county}}</li>
|
||||
<li>state: {{atm.address.state}}</li>
|
||||
<li>postcode: {{atm.address.postcode}}</li>
|
||||
<li>country_code: {{atm.address.country_code}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Location:
|
||||
<ul>
|
||||
<li>latitude: {{atm.location.latitude}}</li>
|
||||
<li>longitude: {{atm.location.longitude}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Meta License:
|
||||
<ul>
|
||||
<li>id: {{atm.meta.license.id}}</li>
|
||||
<li>name: {{atm.meta.license.name}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Routing
|
||||
<ul>
|
||||
<li>Scheme: {{atm.atm_routing.scheme}}</li>
|
||||
<li>Address: {{atm.atm_routing.address}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Type: {{atm.branch_type}}</li>
|
||||
<li>More Info: {{atm.more_info}}</li>
|
||||
<!-- <li>Phone Number: {{atm.phone_number}}</li>-->
|
||||
<li>Accessible Features: {{atm.accessibleFeatures}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><a href="{{ url_branch_update }}" class="btn btn-primary">Update</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %} {% block extrajs %} {% endblock extrajs %} {% block extracss %}
|
||||
{% endblock %} {% block extrajs %} {% endblock extrajs %} {% block extracss %}
|
||||
<link href="{% static 'atms/css/atms.css' %}" rel="stylesheet"> {% endblock extracss %}
|
||||
@ -1,169 +1,170 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block page_title %}{{ block.super }} / Atms{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
{% extends 'base.html' %} {% load static %} {% block page_title %}{{ block.super }} / Atms{% endblock page_title %} {% block content %}
|
||||
<div id="atms">
|
||||
<h1>Update atm</h1>
|
||||
<h2>{{ bank_id }} : {{ atm_id }}</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% if form.non_field_errors %}
|
||||
{% csrf_token %} {% if form.non_field_errors %}
|
||||
<div class="alert alert-danger">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row" style="display: None">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.bank_id.errors %}<div class="alert alert-danger">{{ form.bank_id.errors }}</div>{% endif %}
|
||||
{% if form.bank_id.errors %}
|
||||
<div class="alert alert-danger">{{ form.bank_id.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.bank_id.label_tag }}
|
||||
{{ form.bank_id }}
|
||||
{{ form.bank_id.label_tag }} {{ form.bank_id }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_id.errors %}<div class="alert alert-danger">{{ form.atm_id.errors }}</div>{% endif %}
|
||||
{% if form.atm_id.errors %}
|
||||
<div class="alert alert-danger">{{ form.atm_id.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_id.label_tag }}
|
||||
{{ form.atm_id }}
|
||||
{{ form.atm_id.label_tag }} {{ form.atm_id }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.name.errors %}<div class="alert alert-danger">{{ form.name.errors }}</div>{% endif %}
|
||||
{% if form.name.errors %}
|
||||
<div class="alert alert-danger">{{ form.name.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.name.label_tag }}
|
||||
{{ form.name }}
|
||||
{{ form.name.label_tag }} {{ form.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.location_latitude.errors %}<div class="alert alert-danger">{{ form.location_latitude.errors }}</div>{% endif %}
|
||||
{% if form.location_latitude.errors %}
|
||||
<div class="alert alert-danger">{{ form.location_latitude.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.location_latitude.label_tag }}
|
||||
{{ form.location_latitude }}
|
||||
{{ form.location_latitude.label_tag }} {{ form.location_latitude }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.location_longitude.errors %}<div class="alert alert-danger">{{ form.location_longitude.errors }}</div>{% endif %}
|
||||
{% if form.location_longitude.errors %}
|
||||
<div class="alert alert-danger">{{ form.location_longitude.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.location_longitude.label_tag }}
|
||||
{{ form.location_longitude }}
|
||||
{{ form.location_longitude.label_tag }} {{ form.location_longitude }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.meta_license_id.errors %}<div class="alert alert-danger">{{ form.meta_license_id.errors }}</div>{% endif %}
|
||||
{% if form.meta_license_id.errors %}
|
||||
<div class="alert alert-danger">{{ form.meta_license_id.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.meta_license_id.label_tag }}
|
||||
{{ form.meta_license_id }}
|
||||
{{ form.meta_license_id.label_tag }} {{ form.meta_license_id }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.meta_license_name.errors %}<div class="alert alert-danger">{{ form.meta_license_name.errors }}</div>{% endif %}
|
||||
{% if form.meta_license_name.errors %}
|
||||
<div class="alert alert-danger">{{ form.meta_license_name.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.meta_license_name.label_tag }}
|
||||
{{ form.meta_license_name }}
|
||||
{{ form.meta_license_name.label_tag }} {{ form.meta_license_name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.accessibleFeatures.errors %}<div class="alert alert-danger">{{ form.accessibleFeatures.errors }}</div>{% endif %}
|
||||
{% if form.accessibleFeatures.errors %}
|
||||
<div class="alert alert-danger">{{ form.accessibleFeatures.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.accessibleFeatures.label_tag }}
|
||||
{{ form.accessibleFeatures }}
|
||||
{{ form.accessibleFeatures.label_tag }} {{ form.accessibleFeatures }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_routing_scheme.errors %}<div class="alert alert-danger">{{ form.atm_routing_scheme.errors }}</div>{% endif %}
|
||||
{% if form.atm_routing_scheme.errors %}
|
||||
<div class="alert alert-danger">{{ form.atm_routing_scheme.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_routing_scheme.label_tag }}
|
||||
{{ form.atm_routing_scheme }}
|
||||
{{ form.atm_routing_scheme.label_tag }} {{ form.atm_routing_scheme }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_routing_address.errors %}<div class="alert alert-danger">{{ form.branch_routing_address.errors }}</div>{% endif %}
|
||||
{% if form.atm_routing_address.errors %}
|
||||
<div class="alert alert-danger">{{ form.branch_routing_address.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_routing_address.label_tag }}
|
||||
{{ form.atm_routing_address }}
|
||||
{{ form.atm_routing_address.label_tag }} {{ form.atm_routing_address }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.is_accessible.errors %}<div class="alert alert-danger">{{ form.is_accessible.errors }}</div>{% endif %}
|
||||
{% if form.is_accessible.errors %}
|
||||
<div class="alert alert-danger">{{ form.is_accessible.errors }}</div>
|
||||
{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.is_accessible.label_tag }}
|
||||
{{ form.is_accessible }}
|
||||
{{ form.is_accessible.label_tag }} {{ form.is_accessible }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.services.errors %}<div class="alert alert-danger">{{ form.services.errors }}</div>{% endif %}
|
||||
{% if form.services.errors %}
|
||||
<div class="alert alert-danger">{{ form.services.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.services.label_tag }}
|
||||
{{ form.services }}
|
||||
{{ form.services.label_tag }} {{ form.services }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.more_info.errors %}<div class="alert alert-danger">{{ form.more_info.errors }}</div>{% endif %}
|
||||
{% if form.more_info.errors %}
|
||||
<div class="alert alert-danger">{{ form.more_info.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.more_info.label_tag }}
|
||||
{{ form.more_info }}
|
||||
{{ form.more_info.label_tag }} {{ form.more_info }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.supported_currencies.errors %}<div class="alert alert-danger">{{ form.supported_currencies.errors }}</div>{% endif %}
|
||||
{% if form.supported_currencies.errors %}
|
||||
<div class="alert alert-danger">{{ form.supported_currencies.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.supported_currencies.label_tag }}
|
||||
{{ form.supported_currencies }}
|
||||
{{ form.supported_currencies.label_tag }} {{ form.supported_currencies }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.services.errors %}<div class="alert alert-danger">{{ form.services.errors }}</div>{% endif %}
|
||||
{% if form.services.errors %}
|
||||
<div class="alert alert-danger">{{ form.services.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.services.label_tag }}
|
||||
{{ form.services }}
|
||||
{{ form.services.label_tag }} {{ form.services }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.has_deposit_capability.errors %}<div class="alert alert-danger">{{ form.has_deposit_capability.errors }}</div>{% endif %}
|
||||
{% if form.has_deposit_capability.errors %}
|
||||
<div class="alert alert-danger">{{ form.has_deposit_capability.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.has_deposit_capability.label_tag }}
|
||||
{{ form.has_deposit_capability }}
|
||||
{{ form.has_deposit_capability.label_tag }} {{ form.has_deposit_capability }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.address.errors %}<div class="alert alert-danger">{{ form.address.errors }}</div>{% endif %}
|
||||
{% if form.address.errors %}
|
||||
<div class="alert alert-danger">{{ form.address.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.address.label_tag }}
|
||||
{{ form.address }}
|
||||
{{ form.address.label_tag }} {{ form.address }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.lobby.errors %}<div class="alert alert-danger">{{ form.lobby.errors }}</div>{% endif %}
|
||||
{% if form.lobby.errors %}
|
||||
<div class="alert alert-danger">{{ form.lobby.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.lobby.label_tag }}
|
||||
{{ form.lobby }}
|
||||
{{ form.lobby.label_tag }} {{ form.lobby }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-xs-12 col-sm-4">
|
||||
<!-- <div class="col-xs-12 col-sm-4">
|
||||
{% if form.drive_up.errors %}<div class="alert alert-danger">{{ form.drive_up.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.drive_up.label_tag }}
|
||||
@ -175,18 +176,9 @@
|
||||
<input type="submit" value="Update" class="btn btn-primary" />
|
||||
</form>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block extrajs %}
|
||||
{% comment %}
|
||||
<script type="text/javascript" src="{% static 'branches/js/branches.js' %}"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
{% endcomment %}
|
||||
{% endblock extrajs %}
|
||||
|
||||
|
||||
{% block extracss %}
|
||||
<link href="{% static 'branches/css/branches.css' %}" rel="stylesheet">
|
||||
{% endblock extracss %}
|
||||
|
||||
{% endblock content %} {% block extrajs %} {% comment %}
|
||||
<script type="text/javascript" src="{% static 'branches/js/branches.js' %}"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
{% endcomment %} {% endblock extrajs %} {% block extracss %}
|
||||
<link href="{% static 'branches/css/branches.css' %}" rel="stylesheet"> {% endblock extracss %}
|
||||
@ -39,37 +39,6 @@ class IndexAtmView(LoginRequiredMixin, FormView):
|
||||
fields['notes'].choices = [('','Choose...'),("String1", "String1"), ("String2", "String2")]
|
||||
fields['supported_currencies'].choices = [('','Choose...'),("EUR", "EUR"), ("MXN", "MXN"), ("USD", "USD")]
|
||||
fields['location_categories'].choices = [('','Choose...'),("ATBI", "ATBI"), ("ATBE", "ATBE")]
|
||||
"""fields['drive_up'].initial = json.dumps({
|
||||
"monday": {
|
||||
"opening_time": "10:00",
|
||||
"closing_time": "18:00"
|
||||
},
|
||||
"tuesday": {
|
||||
"opening_time": "10:00",
|
||||
"closing_time": "18:00"
|
||||
},
|
||||
"wednesday": {
|
||||
"opening_time": "10:00",
|
||||
"closing_time": "18:00"
|
||||
},
|
||||
"thursday": {
|
||||
"opening_time": "10:00",
|
||||
"closing_time": "18:00"
|
||||
},
|
||||
"friday": {
|
||||
"opening_time": "10:00",
|
||||
"closing_time": "18:00"
|
||||
},
|
||||
"saturday": {
|
||||
"opening_time": "10:00",
|
||||
"closing_time": "18:00"
|
||||
},
|
||||
"sunday": {
|
||||
"opening_time": "10:00",
|
||||
"closing_time": "18:00"
|
||||
}
|
||||
}, indent=4)"""
|
||||
|
||||
fields['lobby'].initial = json.dumps({
|
||||
"monday": [
|
||||
{
|
||||
@ -153,7 +122,6 @@ class IndexAtmView(LoginRequiredMixin, FormView):
|
||||
}
|
||||
},
|
||||
"lobby": json.loads(data['lobby']),
|
||||
#"drive_up": json.loads(data["drive_up"]),
|
||||
"is_accessible": data["is_accessible"] if data["is_accessible"]!="" else "false",
|
||||
"has_deposit_capability": data["has_deposit_capability"] if data["has_deposit_capability"]!="" else "false",
|
||||
"supported_languages": data["supported_languages"] if data["supported_languages"]!="" else "false",
|
||||
@ -171,7 +139,6 @@ class IndexAtmView(LoginRequiredMixin, FormView):
|
||||
"branch_type": data["branch_type"] if data["branch_type"]!="" else "branch type",
|
||||
"more_info": data["more_info"] if data["more_info"]!="" else "more info",
|
||||
"located_at": data["located_at"] if data["located_at"]!="" else "located_at",
|
||||
"phone_number": data["phone_number"] if data["phone_number"]!="" else "phone number",
|
||||
"services": data["services"] if data["services"]!="" else "services",
|
||||
}
|
||||
result = self.api.post(urlpath, payload=payload)
|
||||
@ -284,7 +251,6 @@ class UpdateAtmView(LoginRequiredMixin, FormView):
|
||||
fields['located_at'].initial = result['located_at']
|
||||
fields['more_info'].initial = result['more_info']
|
||||
fields['located_at'].initial = result['located_at']
|
||||
fields['phone_number'].initial = result['phone_number']
|
||||
fields['lobby'].initial = json.dumps(result['lobby'], indent=4)
|
||||
if result['supported_languages'].lower()=='en':
|
||||
fields['supported_languages'].choices = [("en", "en"), ("fr", "fr"), ("de", "de")]
|
||||
@ -310,7 +276,6 @@ class UpdateAtmView(LoginRequiredMixin, FormView):
|
||||
else:
|
||||
fields['location_categories'].choices = [("ATBE", "ATBE"),("ATBI", "ATBI")]
|
||||
fields['location_categories'].initial = result['location_categories']
|
||||
#fields['drive_up'].initial = json.dumps(result['drive_up'], indent=4)
|
||||
except APIError as err:
|
||||
messages.error(self.request, err)
|
||||
except Exception as err:
|
||||
@ -322,7 +287,7 @@ class UpdateAtmView(LoginRequiredMixin, FormView):
|
||||
data = form.cleaned_data
|
||||
urlpath = '/banks/{}/atms/{}'.format(data["bank_id"], data["atm_id"])
|
||||
payload = {
|
||||
#"id": data["branch_id"],
|
||||
#"id": data["atm_id"],
|
||||
"bank_id": data["bank_id"],
|
||||
"name": data["name"],
|
||||
"address": json.loads(data['address']),
|
||||
@ -337,11 +302,6 @@ class UpdateAtmView(LoginRequiredMixin, FormView):
|
||||
}
|
||||
},
|
||||
"lobby": json.loads(data["lobby"]),
|
||||
#"drive_up": json.loads(data["drive_up"]),
|
||||
"branch_routing": {
|
||||
"scheme": data["atm_routing_scheme"] if data["atm_routing_scheme"] != "" else "license name",
|
||||
"address": data["atm_routing_address"] if data["atm_routing_address"] != "" else "license name"
|
||||
},
|
||||
"has_deposit_capability": data["has_deposit_capability"],
|
||||
"accessibleFeatures": data["accessibleFeatures"],
|
||||
"minimum_withdrawal": data["minimum_withdrawal"],
|
||||
|
||||
@ -39,10 +39,10 @@
|
||||
<label for="password">Password:</label>
|
||||
{{ directlogin_form.password }}
|
||||
</div>
|
||||
<div class="form-group"<!--style="visibility:hidden"-->
|
||||
<!--<div class="form-group"style="visibility:hidden">
|
||||
<label for="consumer-key">Consumer Key:</label>
|
||||
{{ directlogin_form.consumer_key }}
|
||||
</div>
|
||||
</div>-->
|
||||
<button class="btn btn-primary">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -5,6 +5,7 @@ DirectLogin authenticator for OBP app
|
||||
|
||||
|
||||
import requests
|
||||
from apimanager import local_settings
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
@ -28,11 +29,14 @@ class DirectLoginAuthenticator(Authenticator):
|
||||
|
||||
data is a dict which contains keys username, password and consumer_key
|
||||
"""
|
||||
requestheaders['consumer_key']=local_settings.OAUTH_CONSUMER_KEY
|
||||
#print("hello",local_settings.OAUTH_CONSUMER_KEY)
|
||||
url = settings.API_HOST + settings.DIRECTLOGIN_PATH
|
||||
authorization = 'DirectLogin username="{}",password="{}",consumer_key="{}"'.format( # noqa
|
||||
requestheaders['username'],
|
||||
requestheaders['password'],
|
||||
requestheaders['consumer_key'])
|
||||
requestheaders['consumer_key']
|
||||
)
|
||||
headers = {'Authorization': authorization}
|
||||
|
||||
try:
|
||||
|
||||
@ -15,8 +15,8 @@ class DirectLoginForm(forms.Form):
|
||||
attrs={'class': 'form-control'}))
|
||||
password = forms.CharField(widget=forms.PasswordInput(
|
||||
attrs={'class': 'form-control'}))
|
||||
consumer_key = forms.CharField(widget=forms.TextInput(
|
||||
attrs={'class': 'form-control'}))
|
||||
#consumer_key = forms.CharField(widget=forms.TextInput(
|
||||
#attrs={'class': 'form-control'}))
|
||||
|
||||
def clean(self):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user