profcturner / WAM

Workload Allocation Modeller and Assessment Approval System
GNU Affero General Public License v3.0
4 stars 0 forks source link

Email on sign offs need to consider the possibility that lead_programme is not set #38

Closed profcturner closed 5 years ago

profcturner commented 5 years ago

See below. A check is needed here.

Traceback (most recent call last):
  File "/usr/local/share/WAM/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/usr/local/share/WAM/loads/management/commands/email_assessmentupdates.py", line 65, in handle
    if self.email_updates_for_signoff(signoff, options):
  File "/usr/local/share/WAM/loads/management/commands/email_assessmentupdates.py", line 102, in email_updates_for_signoff
    for external in signoff.module.lead_programme.examiners.all():
AttributeError: 'NoneType' object has no attribute 'examiners'