for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from django.contrib.auth import get_user_model
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, signals
from djoser.conf import settings
from djoser.pipelines.base import BasePipeline
User = get_user_model()
User
(([A-Z_][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.
def serialize_request(request, context):
serializer_class = settings.SERIALIZERS.user_delete
serializer = serializer_class(data=request.data, **{'context': context})
if not serializer.is_valid(raise_exception=False):
raise exceptions.ValidationError(serializer.errors)
return {'serializer': serializer}
def perform(request, context):
context
user = request.user
request.user.delete()
return {'user': user}
def signal(request, context):
assert context['user']
user = context['user']
signals.user_deleted.send(sender=None, user=user, request=request)
class Pipeline(BasePipeline):
steps = settings.PIPELINES.user_delete
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.