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 Mar 13, 2020
1 parent b1f9683 commit fa2a487
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions categories/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@

class CategoryM2MField(ManyToManyField):
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):
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)


try:
Expand Down

0 comments on commit fa2a487

Please sign in to comment.