Opened 6 years ago

Closed 8 months ago

Last modified 8 months ago

#13637 closed Bug (fixed)

Generic Relations don't work correctly on a non-default database alias

Reported by: andrewgodwin Owned by:
Component: contrib.contenttypes Version: master
Severity: Normal Keywords: multi-db, truncation
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Specifically, line 195 of contrib.contenttypes.generic uses django.db.connection directly - this needs to be fixed.

It looks like it will need connection-choosing pushed inside the RelatedManager provided. I'm going to work on fixing this - just noting it as a separate ticket to #13528 (I found it while fixing that, but it's a separate issue, pretty much, it affects quoting as well as table name truncation).

Attachments (1)

django-ct-dbs.diff (4.8 KB) - added by Alex 6 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 6 years ago by andrewgodwin

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to andrewgodwin
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 1.1 to SVN

Changed 6 years ago by Alex

comment:2 Changed 5 years ago by julien

  • Severity set to Normal
  • Type set to Bug

comment:3 Changed 5 years ago by anonymous

  • Component changed from Database layer (models, ORM) to contrib.contenttypes

comment:4 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 4 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:6 Changed 2 years ago by andrewgodwin

  • Owner andrewgodwin deleted
  • Status changed from assigned to new

comment:7 Changed 8 months ago by timgraham

  • Has patch set

It looks like the code in question is unused: PR to remove it.

comment:8 Changed 8 months ago by Tim Graham <timograham@…>

In 37a5a36:

Refs #13637 -- Removed unused code in GenericRelatedObjectManager

Appears unused since 585b7acaa359fc1df07269c1a4b4756bdb6703f7.

comment:9 Changed 8 months ago by timgraham

  • Resolution set to fixed
  • Status changed from new to closed

comment:10 Changed 8 months ago by Tim Graham <timograham@…>

In aebe780:

[1.9.x] Refs #13637 -- Removed unused code in GenericRelatedObjectManager

Appears unused since 585b7acaa359fc1df07269c1a4b4756bdb6703f7.

Backport of 37a5a363215d7c0360ff0a8f57856d373e8c1629 from master

Note: See TracTickets for help on using tickets.
Back to Top