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

Error when creating max-migration file #13

Closed
mrswats opened this issue Dec 11, 2020 · 1 comment · Fixed by #14
Closed

Error when creating max-migration file #13

mrswats opened this issue Dec 11, 2020 · 1 comment · Fixed by #14

Comments

@mrswats
Copy link

mrswats commented Dec 11, 2020

Hello again!

The update worked pretty well, now I ran into another problem.

I tried to create said file for all my django apps with the following result:

$ poetry run ./manage.py create-max-migration-files
Created max_migration.txt for tracker
Traceback (most recent call last):
  File "./manage.py", line 39, in <module>
    manage()
  File "./manage.py", line 35, in manage
    execute_from_command_line(sys.argv)
  File "/home/fjm/.cache/pypoetry/virtualenvs/price-tracker-XfPLBuU3-py3.8/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/fjm/.cache/pypoetry/virtualenvs/price-tracker-XfPLBuU3-py3.8/lib/python3.8/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/fjm/.cache/pypoetry/virtualenvs/price-tracker-XfPLBuU3-py3.8/lib/python3.8/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/fjm/.cache/pypoetry/virtualenvs/price-tracker-XfPLBuU3-py3.8/lib/python3.8/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/fjm/.cache/pypoetry/virtualenvs/price-tracker-XfPLBuU3-py3.8/lib/python3.8/site-packages/django_linear_migrations/management/commands/create-max-migration-files.py", line 46, in handle
    max_migration_txt = migration_details.dir / "max_migration.txt"
  File "/home/fjm/.cache/pypoetry/virtualenvs/price-tracker-XfPLBuU3-py3.8/lib/python3.8/site-packages/django/utils/functional.py", line 80, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/fjm/.cache/pypoetry/virtualenvs/price-tracker-XfPLBuU3-py3.8/lib/python3.8/site-packages/django_linear_migrations/apps.py", line 62, in dir
    return Path(self.migrations_module.__file__).parent
AttributeError: 'NoneType' object has no attribute '__file__'

However, it looks like I can do it for individual apps appending the app name at the end without problem.

This time around it has a workaround so it's not so pressing but something to consider.

Thank you!

@adamchainz
Copy link
Owner

Fixed in #14, released in 1.0.2. Thanks again.

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 a pull request may close this issue.

2 participants