'Function checks whether the user is outside the config-defined grace period for inactive accounts.'

def is_outside_grace_period(self, trans, create_time):

    activation_grace_period = trans.app.config.activation_grace_period
    delta = timedelta(hours=int(activation_grace_period))
    time_difference = (datetime.utcnow() - create_time)
    return ((time_difference > delta) or (activation_grace_period == 0))
