mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 19:08:12 +08:00
Linting
This commit is contained in:
@@ -4,19 +4,20 @@ import datetime
|
|||||||
import time
|
import time
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
|
from django.core.signing import BadSignature, SignatureExpired, b64_decode, JSONSerializer, \
|
||||||
|
Signer as Sgnr, TimestampSigner as TsS, dumps
|
||||||
from django.utils import baseconv
|
from django.utils import baseconv
|
||||||
from django.utils.crypto import constant_time_compare
|
from django.utils.crypto import constant_time_compare
|
||||||
from django.utils.encoding import force_bytes, force_str, force_text
|
from django.utils.encoding import force_bytes, force_str, force_text
|
||||||
from django.core.signing import BadSignature, SignatureExpired, b64_decode, JSONSerializer, \
|
|
||||||
Signer as Sgnr, TimestampSigner as TsS, dumps
|
|
||||||
|
|
||||||
dumps = dumps
|
dumps = dumps
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
The loads function is the same as the `django.core.signing.loads` function
|
The loads function is the same as the `django.core.signing.loads` function
|
||||||
The difference is that `this` loads function calls `TimestampSigner` and `Signer`
|
The difference is that `this` loads function calls `TimestampSigner` and `Signer`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def loads(s, key=None, salt='django.core.signing', serializer=JSONSerializer, max_age=None):
|
def loads(s, key=None, salt='django.core.signing', serializer=JSONSerializer, max_age=None):
|
||||||
"""
|
"""
|
||||||
Reverse of dumps(), raise BadSignature if signature fails.
|
Reverse of dumps(), raise BadSignature if signature fails.
|
||||||
@@ -55,6 +56,8 @@ class Signer(Sgnr):
|
|||||||
TimestampSigner is also the same as `django.core.signing.TimestampSigner` but is
|
TimestampSigner is also the same as `django.core.signing.TimestampSigner` but is
|
||||||
calling `this` Signer.
|
calling `this` Signer.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class TimestampSigner(Signer, TsS):
|
class TimestampSigner(Signer, TsS):
|
||||||
|
|
||||||
def unsign(self, value, max_age=None):
|
def unsign(self, value, max_age=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user