Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
gsvr committed Aug 22, 2022
1 parent 55754de commit bb15b0d
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 37 deletions.
2 changes: 0 additions & 2 deletions backend/credits/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.contrib import admin

# Register your models here.
2 changes: 0 additions & 2 deletions backend/credits/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.db import models

# Create your models here.
2 changes: 0 additions & 2 deletions backend/credits/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.test import TestCase

# Create your tests here.
2 changes: 0 additions & 2 deletions backend/credits/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.shortcuts import render

# Create your views here.
2 changes: 0 additions & 2 deletions backend/debits/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.shortcuts import render

# Create your views here.
2 changes: 1 addition & 1 deletion backend/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ def run_task_event_type():
try:
getattr(tasks, instance.event_type.replace(".", "_")
).apply_async(kwargs={"event_id": instance.id})
except:
except Exception:
pass
transaction.on_commit(run_task_event_type)
2 changes: 1 addition & 1 deletion backend/events/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DebitBatchCompleted(Task):
"""
"""
name = "maguire.events.tasks.debit_batch_completed"
l = get_task_logger(__name__)
tl = get_task_logger(__name__)

def run(self, event_id, **kwargs):
# trigger hook
Expand Down
12 changes: 6 additions & 6 deletions backend/maguire/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@


class Query(
debits.schema.Query,
graphene.ObjectType):
pass
debits.schema.Query,
graphene.ObjectType):
pass


class Mutation(
debits.schema.Mutation,
graphene.ObjectType):
pass
debits.schema.Mutation,
graphene.ObjectType):
pass


schema = graphene.Schema(query=Query, mutation=Mutation)
11 changes: 8 additions & 3 deletions backend/maguire/testsettings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from maguire.settings import * # flake8: noqa
from maguire.settings import * # noqa
import json
import os

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'TESTSEKRET'
Expand Down Expand Up @@ -27,5 +29,8 @@

BASE_URL = os.environ.get('BASE_URL', 'http://localhost:8000')

DEBIT_CONFIG = json.loads(os.environ.get('DEBIT_CONFIG', '{"base_url": "https://www.slowdebit.co.za:8888/Services/PaymentService.svc/PartnerServices/","authentication": {"service_reference": "37H2-F00Z-735Q-1B11","username": "uname"},"bank_ref": "PICSA","group_code": "PICSA"}'))

DEBIT_CONFIG = json.loads(os.environ.get(
'DEBIT_CONFIG',
'{"base_url": "https://www.slowdebit.co.za:8888/Services/PaymentService.svc/'
'PartnerServices/","authentication": {"service_reference": "37H2-F00Z-735Q-1B11",'
'"username": "uname"},"bank_ref": "PICSA","group_code": "PICSA"}'))
3 changes: 2 additions & 1 deletion backend/maguire/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def graphql_token_view():
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', admin.site.urls),
url(r'^graphql', graphql_token_view()),
url(r'^graphiql', staff_member_required(csrf_exempt(GraphQLView.as_view(schema=schema, graphiql=True)))),
url(r'^graphiql', staff_member_required(csrf_exempt(
GraphQLView.as_view(schema=schema, graphiql=True)))),
url(r'^api/rest-auth/', include('rest_auth.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
18 changes: 3 additions & 15 deletions backend/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maguire.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)

0 comments on commit bb15b0d

Please sign in to comment.