Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Added my first google style api docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
reinout committed Sep 13, 2016
1 parent be029f2 commit a398191
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.viewcode']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
'sphinx.ext.viewcode', 'sphinx.ext.napoleon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
17 changes: 17 additions & 0 deletions lizard_auth_server/views_api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,23 @@ def get(self, request, *args, **kwargs):
return super(VerifyCredentialsView, self).get(request, *args, **kwargs)

def form_valid(self, form):
"""Return user data when credentials are valid
Args:
form: A :class:`lizard_auth_server.forms.JWTDecryptForm`
instance. It will have the JWT message contents in the
``cleaned_data`` attribute. ``form.site`` is set to the site
that asks us the question.
Returns:
A dict with key ``user`` with user data like first name, last
name.
Raises:
PermissionDenied: when the username/password combo is invalid or
when the user has to access to the site (via its company).
"""
# The JWT message is OK, now verify the username/password and send
# back a reply
user = django_authenticate(username=form.cleaned_data.get('username'),
Expand Down

0 comments on commit a398191

Please sign in to comment.