Skip to content
This repository was archived by the owner on Jan 24, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def login(self, request):
"""Override this and implement the logic for your authentication
method. You are supposed to return ``None`` if authentication
succeeded, ``self.authentication_failed`` otherwise.

If the authentication succeeded you should also set request.user
to the authenticated User."""
raise NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, name, param_type, doc=None, validators=None,
self.validators = validators or []
if self.validators and not hasattr(self.validators, '__iter__'):
self.validators = [self.validators]

validator = get_type_validator(param_type)
if validator and validator.__class__ not in \
[v.__class__ for v in self.validators]:
Expand Down
2 changes: 1 addition & 1 deletion serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def serialize(format, objs, method=None, out=None, **kwargs):
fmt = get_formatter(format)(out=out)
fmt.start()

if objs is None:
if objs is None:
fmt.none()
elif len(objs) == 0:
fmt.empty()
Expand Down
4 changes: 2 additions & 2 deletions serializers/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class Serialization(object):
def __init__(self, name, method):
self.name = name
self.method = method

def apply(self, obj, **kwargs):
return (self.name, self.method(obj, **kwargs))
return (self.name, self.method(obj, **kwargs))

class NoSerializationMethod(RuntimeError):
pass
Expand Down
6 changes: 3 additions & 3 deletions validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class DateTimeValidator(Validator):
def validate(self, value):
if isinstance(value, datetime.datetime):
return value

str2datetime = datetime.datetime.strptime
# trying to guess the format
if len(value) == 16:
Expand All @@ -134,7 +134,7 @@ class DateValidator(Validator):
def validate(self, value):
if isinstance(value, datetime.date):
return value

str2date = datetime.date.strptime
# trying to guess the format
if len(value) == 10:
Expand All @@ -149,7 +149,7 @@ class TimeValidator(Validator):
def validate(self, value):
if isinstance(value, datetime.time):
return value

str2time = datetime.time.strptime
# trying to guess the format
if len(value) == 5:
Expand Down