Skip to content

Commit

Permalink
Merge pull request #21 from Jyrno42/chore-upgrade-deps
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
Jyrno42 committed Feb 18, 2021
2 parents 8568020 + 9701f34 commit 0dd1922
Show file tree
Hide file tree
Showing 12 changed files with 743 additions and 605 deletions.
26 changes: 0 additions & 26 deletions .hgignore

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -10,7 +10,7 @@ black:


isort-run:
isort --recursive $(cmd) -p .
isort . $(cmd)


isort:
Expand Down
4 changes: 3 additions & 1 deletion example/settings.py
Expand Up @@ -87,7 +87,9 @@
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(BASE_DIR, "templates"),],
"DIRS": [
os.path.join(BASE_DIR, "templates"),
],
"APP_DIRS": True,
"OPTIONS": {
"debug": True,
Expand Down
4 changes: 2 additions & 2 deletions example/shop/models.py
Expand Up @@ -21,8 +21,8 @@ def complete(self):

@receiver(transaction_succeeded)
def banklink_success_callback(sender, transaction, **kwargs):
""" Gets called when we have a confirmation from the bank that this transaction was completed.
The logic should only be run on the first callback.
"""Gets called when we have a confirmation from the bank that this transaction was completed.
The logic should only be run on the first callback.
"""
logging.info("Banklink transfer callback with transaction %s", transaction.id)
try:
Expand Down
22 changes: 18 additions & 4 deletions example/shop/views.py
Expand Up @@ -44,7 +44,13 @@ def form_valid(self, form):
# WARNING: Don't use this in production code
old_val = get_links()[bank_name].get("SEND_REF", True)
send_ref = self.request.GET.get("send_ref", "1") == "1"
configure(__only_use_during_tests={bank_name: {"SEND_REF": send_ref,}})
configure(
__only_use_during_tests={
bank_name: {
"SEND_REF": send_ref,
}
}
)

# Create new payment request
payment = create_payment_request(
Expand All @@ -58,7 +64,13 @@ def form_valid(self, form):
)

# restore old SEND_REF value
configure(__only_use_during_tests={bank_name: {"SEND_REF": old_val,}})
configure(
__only_use_during_tests={
bank_name: {
"SEND_REF": old_val,
}
}
)

# Attach the pending transaction object to the Order object
self.object.transaction = payment.transaction
Expand Down Expand Up @@ -89,7 +101,9 @@ def form_valid(self, form):
# Create new auth request
bank_name = form.cleaned_data["bank_name"]
auth_form = create_auth_request(
request=self.request, bank_name=bank_name, response_url=redirect_url,
request=self.request,
bank_name=bank_name,
response_url=redirect_url,
)

# Finally, return the HTTP response which redirects the user to the bank
Expand Down Expand Up @@ -138,7 +152,7 @@ def show_server_error(request):
Templates: `500.html`
Context: sys.exc_info() results
"""
"""
exc_type, exc_value, exc_traceback = sys.exc_info()
error = ExceptionReporter(request, exc_type, exc_value, exc_traceback)
return http.HttpResponseServerError(error.get_traceback_html())

0 comments on commit 0dd1922

Please sign in to comment.