parameters: (self, user, token)
return_statement: return True
docstring: Check that a activation token is correct for a given user.
docstring_summary: Check that a activation token is correct for a given user.
docstring_tokens: Check that a activation token is correct for a given user .
function: def check_token(self, user, token):
          """
          Check that a activation token is correct for a given user.
          """
          # Parse the token
          try:
              ts_b36, hash = token.split('-')
          except ValueError:
              return False
  
          try:
              ts = base36_to_int(ts_b36)
          except ValueError:
              return False
  
          # Check that the timestamp/uid has not been tampered with
          if not constant_time_compare(self._make_token_with_timestamp(user, ts), token):
              return False
  
          # Check the timestamp is within limit
          if (self._num_days(self._today()) - ts) > settings.USERS_EMAIL_CONFIRMATION_TIMEOUT_DAYS:
              return False
  
          return True
function_tokens: def check_token ( self , user , token ) : # Parse the token try : ts_b36 , hash = token . split ( '-' ) except ValueError : return False try : ts = base36_to_int ( ts_b36 ) except ValueError : return False # Check that the timestamp/uid has not been tampered with if not constant_time_compare ( self . _make_token_with_timestamp ( user , ts ) , token ) : return False # Check the timestamp is within limit if ( self . _num_days ( self . _today ( ) ) - ts ) > settings . USERS_EMAIL_CONFIRMATION_TIMEOUT_DAYS : return False return True