Skip to content

Commit

Permalink
fix ValueError in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy committed Feb 24, 2022
1 parent a228b08 commit d1c6ce6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions categories/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ class CategoryM2MField(ManyToManyField):
"""A many to many field to a Category model."""

def __init__(self, **kwargs):
from .models import Category

if "to" in kwargs:
kwargs.pop("to")
super(CategoryM2MField, self).__init__(to=Category, **kwargs)
super(CategoryM2MField, self).__init__(to="categories.Category", **kwargs)


class CategoryFKField(ForeignKey):
"""A foreign key to the Category model."""

def __init__(self, **kwargs):
from .models import Category

if "to" in kwargs:
kwargs.pop("to")
super(CategoryFKField, self).__init__(to=Category, **kwargs)
super(CategoryFKField, self).__init__(to="categories.Category", **kwargs)

0 comments on commit d1c6ce6

Please sign in to comment.