def generate_verification_key(verification_type=None):
 token = security.random_string(30)
 if (not verification_type):
  return token
 expires = (timezone.now() + dt.timedelta(minutes=settings.EXPIRATION_TIME_DICT[verification_type]))
 return {'token': token, 'expires': expires}

def generate_verification_key ( verification_type = None ) : token = security . random_string ( 30 ) if ( not verification_type ) : return token expires = ( timezone . now ( ) + dt . timedelta ( minutes = settings . EXPIRATION_TIME_DICT [ verification_type ] ) ) return { 'token' : token , 'expires' : expires }
generate a one-time verification key with an optional expiration time .