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

Migrations for adjust datetimes: minor fixes #1397

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

chris34
Copy link
Member

@chris34 chris34 commented Feb 25, 2025

No description provided.

…None`

raised an exception during a test migration

```
AttributeError: 'NoneType' object has no attribute 'astimezone'
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "django/core/management/base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
  File "django/core/management/commands/migrate.py", line 356, in handle
    post_migrate_state = executor.migrate(
  File "django/db/migrations/executor.py", line 135, in migrate
    state = self._migrate_all_forwards(
  File "django/db/migrations/executor.py", line 167, in _migrate_all_forwards
    state = self.apply_migration(
  File "django/db/migrations/executor.py", line 252, in apply_migration
    state = migration.apply(state, schema_editor)
  File "django/db/migrations/migration.py", line 132, in apply
    operation.database_forwards(
  File "django/db/migrations/operations/special.py", line 193, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "inyoka/planet/migrations/0006_adjust_datetimes.py", line 11, in adjust_blog_last_sync
    b.last_sync = b.last_sync.astimezone().replace(tzinfo=datetime.timezone.utc)
```
@chris34 chris34 merged commit 2799147 into inyokaproject:staging Feb 27, 2025
21 checks passed
@chris34 chris34 deleted the adjust-datetimes branch February 27, 2025 21:11
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.

1 participant