Exemple #1
0
def mark_preview_url_as_decline(instance):
    course_run = instance.content_type.get_object_for_this_type(pk=instance.object_pk)
    # assign course back to publisher
    course_run.course_run_state.change_owner_role(PublisherUserRole.Publisher)

    # send email for decline preview to publisher
    if waffle.switch_is_active('enable_publisher_email_notifications'):
        send_email_decline_preview(instance, course_run, course_run.preview_url)
Exemple #2
0
def mark_preview_url_as_decline(instance):
    course_run = instance.content_type.get_object_for_this_type(
        pk=instance.object_pk)

    # remove the preview url
    preview_url = course_run.preview_url
    course_run.preview_url = None
    course_run.save()

    # change the owner role
    course_run.course_run_state.change_owner_role(PublisherUserRole.Publisher)

    # send email for decline preview
    if waffle.switch_is_active('enable_publisher_email_notifications'):
        send_email_decline_preview(instance, course_run, preview_url)