data/model/oci/tag.py
def change_tag_expiration(tag_id, expiration_datetime):
    """
    Changes the expiration of the specified tag to the given expiration datetime.

    If the expiration datetime is None, then the tag is marked as not expiring. Returns a tuple of
    the previous expiration timestamp in seconds (if any), and whether the operation succeeded.
    """
    try:
        tag = Tag.get(id=tag_id)
    except Tag.DoesNotExist:
        return (None, False)

    new_end_ms = None
    min_expire_sec = convert_to_timedelta(config.app_config.get("LABELED_EXPIRATION_MINIMUM", "1h"))
    max_expire_sec = convert_to_timedelta(
        config.app_config.get("LABELED_EXPIRATION_MAXIMUM", "104w")
    )

    if expiration_datetime is not None:
        lifetime_start_ts = int(tag.lifetime_start_ms / 1000)

        offset = timegm(expiration_datetime.utctimetuple()) - lifetime_start_ts
        offset = min(max(offset, min_expire_sec.total_seconds()), max_expire_sec.total_seconds())
        new_end_ms = tag.lifetime_start_ms + (offset * 1000)

    if new_end_ms == tag.lifetime_end_ms:
        return (None, True)

    return set_tag_end_ms(tag, new_end_ms)

    Changes the expiration of the specified tag to the given expiration datetime.

    If the expiration datetime is None, then the tag is marked as not expiring. Returns a tuple of
    the previous expiration timestamp in seconds (if any), and whether the operation succeeded.
    
Changes the expiration of the specified tag to the given expiration datetime.
If the expiration datetime is None, then the tag is marked as not expiring. Returns a tuple of
the previous expiration timestamp in seconds (if any), and whether the operation succeeded.
Changes the expiration of the specified tag to the given expiration datetime . If the expiration datetime is None then the tag is marked as not expiring . Returns a tuple of the previous expiration timestamp in seconds ( if any ) and whether the operation succeeded .
def change_tag_expiration(tag_id, expiration_datetime):
    try:
        tag = Tag.get(id=tag_id)
    except Tag.DoesNotExist:
        return (None, False)
    new_end_ms = None
    min_expire_sec = convert_to_timedelta(config.app_config.get("LABELED_EXPIRATION_MINIMUM", "1h"))
    max_expire_sec = convert_to_timedelta(
        config.app_config.get("LABELED_EXPIRATION_MAXIMUM", "104w")
    )
    if expiration_datetime is not None:
        lifetime_start_ts = int(tag.lifetime_start_ms / 1000)
        offset = timegm(expiration_datetime.utctimetuple()) - lifetime_start_ts
        offset = min(max(offset, min_expire_sec.total_seconds()), max_expire_sec.total_seconds())
        new_end_ms = tag.lifetime_start_ms + (offset * 1000)
    if new_end_ms == tag.lifetime_end_ms:
        return (None, True)
    return set_tag_end_ms(tag, new_end_ms)
def change_tag_expiration ( tag_id , expiration_datetime ) : try : tag = Tag . get ( id = tag_id ) except Tag . DoesNotExist : return ( None , False ) new_end_ms = None min_expire_sec = convert_to_timedelta ( config . app_config . get ( "LABELED_EXPIRATION_MINIMUM" , "1h" ) ) max_expire_sec = convert_to_timedelta ( config . app_config . get ( "LABELED_EXPIRATION_MAXIMUM" , "104w" ) ) if expiration_datetime is not None : lifetime_start_ts = int ( tag . lifetime_start_ms / 1000 ) offset = timegm ( expiration_datetime . utctimetuple ( ) ) - lifetime_start_ts offset = min ( max ( offset , min_expire_sec . total_seconds ( ) ) , max_expire_sec . total_seconds ( ) ) new_end_ms = tag . lifetime_start_ms + ( offset * 1000 ) if new_end_ms == tag . lifetime_end_ms : return ( None , True ) return set_tag_end_ms ( tag , new_end_ms )
Changes the expiration of the specified tag to the given expiration datetime.
Changes the expiration of the specified tag to the given expiration datetime .
"""
    Changes the expiration of the specified tag to the given expiration datetime.

    If the expiration datetime is None, then the tag is marked as not expiring. Returns a tuple of
    the previous expiration timestamp in seconds (if any), and whether the operation succeeded.
    """
tag_id
expiration_datetime