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

Add related name to Comments.author #127

Merged
merged 3 commits into from
Sep 29, 2021

Conversation

bernd-wechner
Copy link
Contributor

Fixing Issue 126:

#126

@bernd-wechner bernd-wechner force-pushed the fix-comment-clash branch 2 times, most recently from 365b443 to dff907e Compare September 22, 2021 11:48
@@ -0,0 +1,20 @@
# Generated by Django 2.2.24 on 2021-09-22 22:05
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give the migration a useful filename, like 0012_set_comments_related_name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do. Have to work out how first 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -133,7 +133,8 @@ class Comment(models.Model):
"""

author = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True,
related_name="todo_comments"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think this change would break todo code in at least one place, no? Will test soon. But the system still works for you?

Copy link
Contributor Author

@bernd-wechner bernd-wechner Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All existing tests passed. The code is running live and in use. And there are no references to comment_set, the default related_name anywhere in the code base. Looks safe to me.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you for looking.

Copy link
Owner

@shacker shacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrates and works perfectly for me, thanks!

@shacker shacker merged commit db406c4 into shacker:master Sep 29, 2021
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

Successfully merging this pull request may close these issues.

2 participants