I am running datamigrations for my project. My aim is to make a user follow all his articles which were created before the activity stream was implemented
I had created the migration file using the command
python manage.py datamigration articles das_user_migrate_data --freeze auth --settings=maldio_project.settings.dev_keval
for the forward function I have the following code,
def forwards(self, orm):
registry.register(orm['articles.article'])
for articles in orm['articles.article'].objects.all():
user = orm['auth.User'].objects.get(username=article.submitter.username)
follow(user, article, actor_only=False)
I have the proper imports needed for the operation. But while running the migrate
command I get the following error
ValueError: Cannot assign "<User: User object>": "Follow.user" must be a "User" instance.
I have seen other questions with the same error but the solutions mentioned didn't work for me.