fix. settings.hasattr => hasattr(settings, ...)