Fixing docstring formatting for param

Currently, ''.. param:' is being used. The correct format for sphinx is
':param <name>:'

The current format raises errors when building the docs. This patch
corrects the formatting and eliminates the errors.

Closes-Bug: #1474972
Change-Id: I924f860dfe91c4c785d9c656825c31038072dd07
This commit is contained in:
David Lyle 2015-07-15 12:05:52 -06:00
parent ff51ae3a5e
commit 1524a22dcf
3 changed files with 9 additions and 16 deletions

View File

@ -233,8 +233,7 @@ class User(models.AnonymousUser):
Returns ``True`` if the token is expired, ``False`` if not, and Returns ``True`` if the token is expired, ``False`` if not, and
``None`` if there is no token set. ``None`` if there is no token set.
.. param:: margin :param margin:
A security time margin in seconds before real expiration. A security time margin in seconds before real expiration.
Will return ``True`` if the token expires in less than ``margin`` Will return ``True`` if the token expires in less than ``margin``
seconds of time. seconds of time.
@ -249,8 +248,7 @@ class User(models.AnonymousUser):
def is_authenticated(self, margin=None): def is_authenticated(self, margin=None):
"""Checks for a valid authentication. """Checks for a valid authentication.
.. param:: margin :param margin:
A security time margin in seconds before end of authentication. A security time margin in seconds before end of authentication.
Will return ``False`` if authentication ends in less than ``margin`` Will return ``False`` if authentication ends in less than ``margin``
seconds of time. seconds of time.
@ -266,8 +264,7 @@ class User(models.AnonymousUser):
Returns ``True`` if not authenticated,``False`` otherwise. Returns ``True`` if not authenticated,``False`` otherwise.
.. param:: margin :param margin:
A security time margin in seconds before end of an eventual A security time margin in seconds before end of an eventual
authentication. authentication.
Will return ``True`` even if authenticated but that authentication Will return ``True`` even if authenticated but that authentication

View File

@ -80,12 +80,9 @@ def is_token_valid(token, margin=None):
Returns ``True`` if the token has not yet expired, otherwise ``False``. Returns ``True`` if the token has not yet expired, otherwise ``False``.
.. param:: token :param token: The openstack_auth.user.Token instance to check
The openstack_auth.user.Token instance to check
.. param:: margin
:param margin:
A time margin in seconds to subtract from the real token's validity. A time margin in seconds to subtract from the real token's validity.
An example usage is that the token can be valid once the middleware An example usage is that the token can be valid once the middleware
passed, and invalid (timed-out) during a view rendering and this passed, and invalid (timed-out) during a view rendering and this

View File

@ -153,12 +153,11 @@ def websso(request):
def logout(request, login_url=None, **kwargs): def logout(request, login_url=None, **kwargs):
"""Logs out the user if he is logged in. Then redirects to the log-in page. """Logs out the user if he is logged in. Then redirects to the log-in page.
.. param:: login_url :param login_url:
Once logged out, defines the URL where to redirect after login
Once logged out, defines the URL where to redirect after login :param kwargs:
see django.contrib.auth.views.logout_then_login extra parameters.
.. param:: kwargs
see django.contrib.auth.views.logout_then_login extra parameters.
""" """
msg = 'Logging out user "%(username)s".' % \ msg = 'Logging out user "%(username)s".' % \