Commit 1df1378f authored by Jannis Leidel's avatar Jannis Leidel
Browse files

Fixed #13827 -- Cleaned up a few unnecessary function calls.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent d8d38ec6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ class Settings(object):
                new_installed_apps.append(app)
        self.INSTALLED_APPS = new_installed_apps

        if hasattr(time, 'tzset') and getattr(self, 'TIME_ZONE'):
        if hasattr(time, 'tzset') and self.TIME_ZONE:
            # When we can, attempt to validate the timezone. If we can't find
            # this file, no check happens and it's harmless.
            zoneinfo_root = '/usr/share/zoneinfo'
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ def validate_inline(cls, parent, parent_model):
    fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)

    # extra = 3
    if not isinstance(getattr(cls, 'extra'), int):
    if not isinstance(cls.extra, int):
        raise ImproperlyConfigured("'%s.extra' should be a integer."
                % cls.__name__)

+3 −6
Original line number Diff line number Diff line
@@ -20,15 +20,12 @@ def load_backend(path):
        cls = getattr(mod, attr)
    except AttributeError:
        raise ImproperlyConfigured('Module "%s" does not define a "%s" authentication backend' % (module, attr))
    try:
        getattr(cls, 'supports_object_permissions')
    except AttributeError:
    if not hasattr(cls, "supports_object_permissions"):
        warn("Authentication backends without a `supports_object_permissions` attribute are deprecated. Please define it in %s." % cls,
             PendingDeprecationWarning)
        cls.supports_object_permissions = False
    try:
        getattr(cls, 'supports_anonymous_user')
    except AttributeError:

    if not hasattr(cls, 'supports_anonymous_user'):
        warn("Authentication backends without a `supports_anonymous_user` attribute are deprecated. Please define it in %s." % cls,
             PendingDeprecationWarning)
        cls.supports_anonymous_user = False
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ def kml(request, label, model, field_name=None, compress=False, using=DEFAULT_DB
        else:
            qs = klass._default_manager.using(using).all()
        for mod in qs:
            setattr(mod, 'kml', getattr(mod, field_name).kml)
            mod.kml = getattr(mod, field_name).kml)
            placemarks.append(mod)

    # Getting the render function and rendering to the correct.
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ def get_cache(backend_uri):
    else:
        name = scheme
    module = importlib.import_module(name)
    return getattr(module, 'CacheClass')(host, params)
    return module.CacheClass(host, params)

cache = get_cache(settings.CACHE_BACKEND)

Loading