for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from rest_framework import serializers
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
from djoser import exceptions
def default_view_pipeline_adapter(pipeline, request):
try:
result = pipeline(request).run()
except exceptions.ValidationError as e:
e
(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
raise serializers.ValidationError(e.errors)
return result.get('response_data')
class BasePipeline(object):
steps = None
def __init__(self, request, steps=None):
self._request = request
if steps is not None:
self.steps = steps
def run(self):
assert self.steps is not None, (
'Pipeline `steps` have not been specified. '
'They are required to run the pipeline.'
)
context = {'request': self._request}
for step_func in self.steps:
step_context = step_func(**context) or {}
context.update(step_context)
return context
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.