Code reference › domain › submission

module

pretalx.submission.domain.submission_type

Functions 4

apply_submission_type_field_changes(submission_type, changed_fields)source
def apply_submission_type_field_changes(submission_type, changed_fields):
    if "default_duration" in changed_fields:
        propagate_default_duration(submission_type)
    if (
        "attendee_signup_required" in changed_fields
        and submission_type.attendee_signup_required is False
    ):
        return pin_signup_required(submission_type.submissions.all())
    return []
can_delete_submission_type(submission_type) -> boolsource
def can_delete_submission_type(submission_type) -> bool:
    if submission_type.event.cfp.default_type_id == submission_type.pk:
        return False
    return not submission_type.submissions.exists()
make_default_submission_type(submission_type, *, person=None)source
def make_default_submission_type(submission_type, *, person=None):
    cfp = submission_type.event.cfp
    if cfp.default_type_id == submission_type.pk:
        return
    with transaction.atomic():
        cfp.default_type = submission_type
        cfp.save(update_fields=["default_type"])
        submission_type.log_action(
            "pretalx.submission_type.make_default", person=person, orga=True
        )
propagate_default_duration(submission_type)source
def propagate_default_duration(submission_type):
    for submission in submission_type.submissions.select_related(
        "event", "submission_type"
    ).filter(duration__isnull=True):
        update_duration(submission)