Skip to content

sync_db_to_hubspot --lines create fails when courseware related to product is deleted. #1713

@collinpreston

Description

@collinpreston

Steps to Reproduce

  • Create a course or program.
  • Create a product related the course or program .
  • Create a course run enrollment for your user into the course, or a program enrollment into the program through Django Admin.
  • Delete the course or program.
  • Run ./manage.py create_order_from_course_run_enrollments
  • Run ./manage.py sync_db_to_hubspot --deals create
  • Run ./manage.py sync_db_to_hubspot --lines create

Expected Behavior

Lines are created in HubSpot.

Actual Behavior

Error is thrown and Lines are never synced with HubSpot

Stacktrace

https://mit-office-of-digital-learning.sentry.io/issues/4276444264/?environment=rc&project=5864687&query=is%3Aunresolved&referrer=issue-stream&stream_index=3

Addition info

I would not expect a course or program to ever be deleted after a product has been created which is associated with the courseware, but this is the current environment in RC. Refer to Product with ID=2.

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