Permalink
Commits on Jan 19, 2017
  1. Refs #23919 -- Replaced io.open() with open().

    aaugustin committed with timgraham Jan 18, 2017
    io.open() is an alias for open() on Python 3.
  2. Refs #23919 -- Removed obsolete __ne__() methods.

    aaugustin committed with timgraham Jan 18, 2017
    __ne__() defaults to the opposite of __eq__() on Python 3
    when it doesn't return NotImplemented.
Commits on Nov 25, 2016
  1. Fixed #25966 -- Made get_user_model() work at import time.

    aaugustin committed with MarkusH Sep 30, 2016
    This makes it equivalent to: `from django.contrib.auth.models import User`.
    
    Thanks Aymeric Augustin for the initial patch and Tim Graham for the
    review.
Commits on Nov 5, 2016
Commits on Oct 28, 2016
  1. Added require_ready argument to get_model methods.

    aaugustin committed with timgraham May 3, 2016
    This allows bringing back the behavior of Django < 1.7.
    
    Also fixed the check for the app registry being ready in
    AppConfig.get_model(s), which was inconsistent with the equivalent check in
    Apps.get_model(s). That part is a backwards-incompatible change.
  2. Simplified AppConfig.import_models().

    aaugustin committed with timgraham Sep 30, 2016
    Since AppConfig now has a reference to its parent Apps registry,
    it can look up the models there instead of receiving them in argument.
  3. Modified readiness check in AppConfig.get_model(s).

    aaugustin committed with timgraham Sep 30, 2016
    It was inconsistent with the equivalent check in Apps.get_model(s)
    because I made incorrect assumptions when I wrote that code and
    needlessly complicated readiness checks.
    
    This is a backwards-incompatible change.
Commits on Oct 6, 2016
Commits on Mar 25, 2016
  1. Fixed #26408 -- Updated link to DEP 182.

    aaugustin committed Mar 25, 2016
    Thanks kaifeldhoff for the report.
Commits on Feb 23, 2016
  1. Prevented static file corruption when URL fragment contains '..'.

    aaugustin committed Feb 23, 2016
    When running collectstatic with a hashing static file storage backend,
    URLs referencing other files were normalized with posixpath.normpath.
    This could corrupt URLs: for example 'a.css#b/../c' became just 'c'.
    
    Normalization seems to be an artifact of the historical implementation.
    It contained a home-grown implementation of posixpath.join which relied
    on counting occurrences of .. and /, so multiple / had to be collapsed.
    
    The new implementation introduced in the previous commit doesn't suffer
    from this issue. So it seems safe to remove the normalization.
    
    There was a test for this normalization behavior but I don't think it's
    a good test. Django shouldn't modify CSS that way. If a developer has
    rendundant /s, it's mostly an aesthetic issue and it isn't Django's job
    to fix it. Conversely, if the user wants a series of /s, perhaps in the
    URL fragment, Django shouldn't destroy it.
    
    Refs #26249.
  2. Fixed #26249 -- Fixed collectstatic crash for files in STATIC_ROOT re…

    aaugustin committed Feb 20, 2016
    …ferenced by absolute URL.
    
    collectstatic crashed when:
    
    * a hashing static file storage backend was used
    * a static file referenced another static file located directly in
      STATIC_ROOT (not a subdirectory) with an absolute URL (which must
      start with STATIC_URL, which cannot be empty)
    
    It seems to me that the current code reimplements relative path joining
    and doesn't handle edge cases correctly. I suspect it assumes that
    STATIC_URL is of the form r'/[^/]+/'.
    
    Throwing out that code in favor of the posixpath module makes the logic
    easier to follow. Handling absolute paths correctly also becomes easier.
Commits on Jan 21, 2016
  1. Fixed #26063 -- Crash when passing > 2000 params.

    aaugustin committed Jan 9, 2016
    If SQLITE_MAX_VARIABLE_NUMBER (default = 999) is changed at compile time
    to be greater than SQLITE_MAX_COLUMN (default = 2000), which Debian does
    by setting the former to 250000, Django raised an exception on queries
    containing more than 2000 parameters when DEBUG = True.
Commits on Jan 3, 2016
Commits on Nov 26, 2015
  1. Fixed #25302 (again) -- Ignored scheme when checking for bad referers.

    aaugustin committed Nov 26, 2015
    The check introduced in 4ce433e was too strict in real life. The poorly
    implemented bots this patch attempted to ignore are sloppy when it comes
    to http vs. https.
Commits on Nov 7, 2015
  1. Fixed debug view crash during autumn DST change.

    aaugustin committed Nov 7, 2015
    This only happens if USE_TZ = False and pytz is installed (perhaps not
    the most logical combination, but who am I to jugde?)
    
    Refs #23714 which essentially fixed the same problem when USE_TZ = True.
    
    Thanks Florian and Carl for insisting until I wrote a complete patch.
Commits on Oct 18, 2015
  1. Fixed #25510 -- Allowed runserver to start with incorrect INSTALLED_A…

    aaugustin committed Oct 15, 2015
    …PPS.
    
    In that case, the content of INSTALLED_APPS will be ignored until it's
    fixed and the autoreloader kicks in. I confirmed this behavior manually.
    As explained on the ticket it's hard to write a test for this case
Commits on Sep 22, 2015
  1. Recommended against default_app_config.

    aaugustin committed Sep 21, 2015
    Most likely this is a losing fight -- people seem to love this small
    convention -- but at least the reasons for avoiding it will be
    documented.
    
    Refs #25356.
Commits on Sep 21, 2015
  1. Fix import sorting problem.

    aaugustin committed Sep 21, 2015
  2. Fixed #24921 -- set_autocommit(False) + ORM queries.

    aaugustin committed Sep 21, 2015
    This commits lifts the restriction that the outermost atomic block must
    be declared with savepoint=False. This restriction was overly cautious.
    
    The logic that makes it safe not to create savepoints for inner blocks
    also applies to the outermost block when autocommit is disabled and a
    transaction is already active.
    
    This makes it possible to use the ORM after set_autocommit(False).
    Previously it didn't work because ORM write operations are protected
    with atomic(savepoint=False).
  3. Documented "rel objects".

    aaugustin committed Sep 20, 2015
    Kept the docstring short because these objects aren't very well defined
    and they're in the crosshairs of several refactorings.
  4. Renamed descriptor classes for related objects.

    aaugustin committed Sep 20, 2015
    The old names were downright confusing. Some seemed to mean the opposite
    of what the class actually did.
    
    The new names follow a consistent nomenclature:
    
        (Forward|Reverse)(ManyToOne|OneToOne|ManyToMany)Descriptor.
    
    I mentioned combinations that do not exist in the docstring in order to
    help people who would search for them in the code base.
  5. Documented related models descriptors.

    aaugustin committed Sep 19, 2015
    Changed the poll / choices example to a more obvious parent / children.
    I think that reduces the cognitive load.
  6. Fixed #22341 -- Split django.db.models.fields.related.

    aaugustin committed Sep 19, 2015
    At 2800 lines it was the largest module in the django package. This
    commit brings it down to a more manageable 1620 lines.
    
    Very small changes were performed to uniformize import style.
Commits on Sep 19, 2015
  1. Fixed #25160 (again) -- Moved data loss check on reverse relations.

    aaugustin committed Sep 19, 2015
    Moved data loss check when assigning to a reverse one-to-one relation on
    an unsaved instance to Model.save(). This is exactly the same change as
    e4b813c but for reverse relations.
Commits on Sep 17, 2015
Commits on Sep 14, 2015
  1. Fixed runtests.py message about parallel processes.

    aaugustin committed Sep 12, 2015
    It didn't work anymore since the commit that enabled test
    parallelization by default because parallel was equal to 0
    at that point.
  2. Prevented --parallel from crashing on Windows.

    aaugustin committed Sep 12, 2015
    Since --parallel is documented not to work on Windows, it's better to
    ignore it and run without parallelization than to crash. For example
    this could simplify cross-platform test scripts.
Commits on Sep 10, 2015
  1. And fixed merge accident :-(

    aaugustin committed Sep 10, 2015
  2. Adjusted previous commit.

    aaugustin committed Sep 10, 2015
    Sigh.
  3. Refs #20461 -- Made tblib optional for a passing test run.

    aaugustin committed Sep 10, 2015
    This was the original intent.
  4. Merge pull request #4761 from aaugustin/parallelize-tests-attempt-1

    aaugustin committed Sep 10, 2015
    Fixed #20461 -- Allowed running tests in parallel.
  5. Documented that the parallel test runner doesn't work on Windows.

    aaugustin committed Sep 10, 2015
  6. Avoided running more test processes than necessary.

    aaugustin committed Sep 10, 2015
    This reduces the time spent cloning databases.
    
    Thanks Tim for the suggestion.