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

truncate_request_token_log fails #61

Open
mozgovipc opened this issue Feb 14, 2023 · 0 comments
Open

truncate_request_token_log fails #61

mozgovipc opened this issue Feb 14, 2023 · 0 comments

Comments

@mozgovipc
Copy link

mozgovipc commented Feb 14, 2023

Running python manage.py truncate_request_token_log --max-days=90 raises an exception:

Truncating request token log records:
-> Retaining last 90 days' request token log records
Traceback (most recent call last):
  File "manage.py", line 30, in <module>
    main()
  File "manage.py", line 26, in main
    execute_from_command_line(sys.argv)
  File ".venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File ".venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ".venv/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File ".venv/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File ".venv/lib/python3.9/site-packages/request_token/management/commands/truncate_request_token_log.py", line 69, in handle
    timestamp = max(t1, t2)
TypeError: can't compare offset-naive and offset-aware datetimes

The same behaviour if using the max-count argument.

Python 3.9.4 + Django 3.2.16 (with USE_TZ = True) + MySQL 8.0.31

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