mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-09 08:00:39 +03:00
Fixed PEP8-Python3 errors
This commit is contained in:
parent
577b76e436
commit
b9723356fe
|
@ -1,8 +1,6 @@
|
||||||
from promise import Promise
|
from promise import Promise
|
||||||
from django.db import connections
|
from django.db import connections
|
||||||
|
|
||||||
from ....core.schema import GraphQLSchema
|
|
||||||
from ....core.types import Field
|
|
||||||
from .sql.tracking import unwrap_cursor, wrap_cursor
|
from .sql.tracking import unwrap_cursor, wrap_cursor
|
||||||
from .types import DjangoDebug
|
from .types import DjangoDebug
|
||||||
|
|
||||||
|
@ -47,8 +45,10 @@ class DjangoDebugMiddleware(object):
|
||||||
raise Exception('DjangoDebug cannot be executed in None contexts')
|
raise Exception('DjangoDebug cannot be executed in None contexts')
|
||||||
try:
|
try:
|
||||||
context.django_debug = DjangoDebugContext()
|
context.django_debug = DjangoDebugContext()
|
||||||
except Exception, e:
|
except Exception:
|
||||||
raise Exception('DjangoDebug need the context to be writable, context received: {}.'.format(context.__class__.__name__))
|
raise Exception('DjangoDebug need the context to be writable, context received: {}.'.format(
|
||||||
|
context.__class__.__name__
|
||||||
|
))
|
||||||
if info.schema.graphene_schema.T(DjangoDebug) == info.return_type:
|
if info.schema.graphene_schema.T(DjangoDebug) == info.return_type:
|
||||||
return context.django_debug.get_debug_promise()
|
return context.django_debug.get_debug_promise()
|
||||||
promise = next(root, args, context, info)
|
promise = next(root, args, context, info)
|
||||||
|
|
|
@ -10,6 +10,7 @@ from django.utils.encoding import force_text
|
||||||
|
|
||||||
from .types import DjangoDebugSQL, DjangoDebugPostgreSQL
|
from .types import DjangoDebugSQL, DjangoDebugPostgreSQL
|
||||||
|
|
||||||
|
|
||||||
class SQLQueryTriggered(Exception):
|
class SQLQueryTriggered(Exception):
|
||||||
"""Thrown when template panel triggers a query"""
|
"""Thrown when template panel triggers a query"""
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from functools import wraps, partial
|
from functools import wraps
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from graphql.type import GraphQLField, GraphQLInputObjectField
|
from graphql.type import GraphQLField, GraphQLInputObjectField
|
||||||
|
|
Loading…
Reference in New Issue
Block a user