Skip to content

bit rot in create_test_nomcom management command #6093

Description

@jennifer-richards

Describe the issue

I've stumbled upon a couple bugs in the create_test_nomcom management command. It's a niche tool, so I'm grouping these into a single issue.

  • The private key that is helpfully printed at the end of the process is printed as a literal Python bytestring with \n instead of newlines. This should be printed in a format that can be copied and pasted without further processing.
  • The --delete option does not seem to clean up Person records correctly. After using it to delete a test nomcom, creating a new one ends with
    ietf/utils/mail.py(142) in send_smtp(): sent email (0.001s) from 'django-project@ietf.org' to ['iesg-secretary@ietf.org'] id <169150598993.2041.7767556337674594190@de66f53f5a84> subject 'Possible duplicate Person objects for Test Chair'
Traceback (most recent call last):
  File "/workspace/ietf/manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/dev/.local/lib/python3.9/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/home/dev/.local/lib/python3.9/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/dev/.local/lib/python3.9/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/dev/.local/lib/python3.9/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/workspace/ietf/nomcom/management/commands/create_test_nomcom.py", line 43, in handle
    e.person.user.set_password('password')
AttributeError: 'NoneType' object has no attribute 'set_password'

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions