DarrenOfficial / dpaste

The Django project driving dpaste.org
https://dpaste.org
MIT License
532 stars 123 forks source link

cleanup snippets error #215

Closed shinglesware closed 2 years ago

shinglesware commented 2 years ago

Running the cleanup_snippets via ./manage.py cleanup_snippets produces the following error for me. Changing line 42 in dpaste/management/commands/cleanup_snippets.py to deleteable_snippets = (deleteable_snippets | onetime_unviewed_snippets) seems to have fixed the issue for me. Please advise if that is the appropriate fix.

🐘  Database URL is: sqlite:////app/sqlite/dpaste.sqlite

πŸš€  Production webserver installed. Will run on port 8000

🧁  Using local.py settings file.
Traceback (most recent call last):
  File "/app/manage.py", line 34, in <module>
    main()
  File "/app/manage.py", line 30, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/app/dpaste/management/commands/cleanup_snippets.py", line 42, in handle
    deleteable_snippets = (expired_snippets | onetime_unviewed_snippets)
NameError: name 'expired_snippets' is not defined
DarrenOfficial commented 2 years ago

That is indeed the appropriate fix