(domain, user_id, now=None, valid=None)
return record
return initialized but unsaved MobileAuthKeyRecord
return initialized but unsaved MobileAuthKeyRecord
return initialized but unsaved MobileAuthKeyRecord
def new_key_record(domain, user_id, now=None, valid=None):
    """
    return initialized but unsaved MobileAuthKeyRecord

    """
    from corehq.apps.mobile_auth.models import MobileAuthKeyRecord
    now = now or datetime.utcnow()
    valid = valid or now
    record = MobileAuthKeyRecord(
        domain=domain,
        user_id=user_id,
        valid=valid,
    )
    bump_expiry(record, now=now)

    return record
def new_key_record ( domain , user_id , now = None , valid = None ) : from corehq . apps . mobile_auth . models import MobileAuthKeyRecord now = now or datetime . utcnow ( ) valid = valid or now record = MobileAuthKeyRecord ( domain = domain , user_id = user_id , valid = valid , ) bump_expiry ( record , now = now ) return record