Ticket #20687: ticket-20687-1.patch

File ticket-20687-1.patch, 1.8 KB (added by Tomáš Ehrlich, 11 years ago)

Fixed typo and rephrased.

  • django/core/signing.py

    diff --git a/django/core/signing.py b/django/core/signing.py
    index d7f86f5..c3b2c3e 100644
    a b class TimestampSigner(Signer):  
    184184
    185185    def unsign(self, value, max_age=None):
    186186        """
    187         Retrieve original value and check it wasn't signed longer than
    188         max_age before (in seconds).
    189 
     187        Retrieve original value and check it wasn't signed more
     188        than max_age seconds ago.
    190189        """
    191190        result =  super(TimestampSigner, self).unsign(value)
    192191        value, timestamp = result.rsplit(self.sep, 1)
  • docs/topics/signing.txt

    diff --git a/docs/topics/signing.txt b/docs/topics/signing.txt
    index d7bccf4..294fa69 100644
    a b created within a specified period of time::  
    127127
    128128.. class:: TimestampSigner(key=None, sep=':', salt=None)
    129129
    130 .. function:: TimestampSigner.sign(value)
     130.. method:: TimestampSigner.sign(value)
    131131
    132132    Sign ``value`` and append current timestamp to it.
    133133
    134 .. function:: TimestampSigner.unsing(value, max_age=None)
     134.. method:: TimestampSigner.unsign(value, max_age=None)
    135135
    136     Checks if ``value`` was signed less than ``max_age`` seconds before, otherwise
    137     raises ``SignatureExpired``
     136    Checks if ``value`` wasn't signed more than ``max_age`` seconds ago,
     137    otherwise raises ``SignatureExpired``.
    138138
    139139Protecting complex data structures
    140140----------------------------------
    to execute arbitrary commands by exploiting the pickle format.::  
    159159
    160160.. function:: loads(string, key=None, salt='django.core.signing', max_age=None)
    161161
    162     Reverse of ``dumps()``, raises ``BadSignature`` if signature fails. Optionaly
    163     checks ``max_age`` (in seconds).
     162    Reverse of ``dumps()``, raises ``BadSignature`` if signature fails.
     163    Checks ``max_age`` (in seconds) if given.
Back to Top