Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenericForeignKey regression after #224 #230

Closed
decibyte opened this issue Apr 25, 2019 · 1 comment
Closed

GenericForeignKey regression after #224 #230

decibyte opened this issue Apr 25, 2019 · 1 comment

Comments

@decibyte
Copy link

decibyte commented Apr 25, 2019

$ pip freeze | grep pylint
pylint==2.3.1
pylint-django==2.0.8
pylint-plugin-utils==0.5

I tested with version 2.0.6, the last version before #224 was merged, and that version doesn't have this issue.

I'm getting a TypeError: 'NoneType' object is not iterable for a model similar to the following example. It's triggered by this line.

# models.py

from django.contrib.contenttypes.fields import GenericForeignKey                
from django.contrib.contenttypes.models import ContentType
from django.db import models

class Ownership(models.Model):
    owner_type = models.ForeignKey(ContentType, models.CASCADE)
    owner_id = models.PositiveIntegerField()
    owner = GenericForeignKey("owner_type", "owner_id")
@decibyte
Copy link
Author

Wow, that was quick! Thanks, @atodorov :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant