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

Failed migration #126

Open
bernd-wechner opened this issue Sep 22, 2021 · 0 comments
Open

Failed migration #126

bernd-wechner opened this issue Sep 22, 2021 · 0 comments

Comments

@bernd-wechner
Copy link
Contributor

Love this. Just taking a quick spin plugging it into a development version of our tendenci site (for a club)

Following Installation here: https://django-todo.readthedocs.io/en/latest/

  1. I set SITE_ID = 1, all good
  2. I did pip install django-todo, all good
  3. I added it to INSTALLED_APPS: INSTALLED_APPS += ['todo']
  4. I tried migrating: python manage.py migrate todo

But it bombs with:

ERRORS:
contacts.Comment.creator: (fields.E304) Reverse accessor for 'Comment.creator' clashes with reverse accessor for 'Comment.author'.
	HINT: Add or change a related_name argument to the definition for 'Comment.creator' or 'Comment.author'.
todo.Comment.author: (fields.E304) Reverse accessor for 'Comment.author' clashes with reverse accessor for 'Comment.creator'.
	HINT: Add or change a related_name argument to the definition for 'Comment.author' or 'Comment.creator'.

That looks like a fairly simple issue, but surprises me immensely to see in the pip installed code. It seems simple enough to me, in that inside the Comment model:

class Comment(models.Model):

Tendenci and todo both implement a Comment model with ForeignKey to AUTH_USER_MODEL and neither specified a related_name argument so they both attempt to implement comment_set on the user. This is actually worth a fix in both apps, as neither should be attaching such a contextless comment to users.

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