<s> from . models import PasswordExpiry <EOL> from django . conf import settings <EOL> def password_is_expired ( user ) : <EOL> password_expiry , _ = PasswordExpiry . objects . get_or_create ( user = user ) <EOL> password_settings = getattr ( settings , '<STR_LIT>' , { } ) <EOL> include_superusers = password_settings . get ( '<STR_LIT>' , False ) <EOL> if include_superusers : <EOL> return password_expiry . is_expired ( ) <EOL> else : <EOL> return not user . is_superuser and password_expiry . is_expired ( ) <EOL> def never_expire_password ( user ) : <EOL> password_expiry , _ = PasswordExpiry . objects . get_or_create ( user = user ) <EOL> password_expiry . never_expire ( ) </s>
