Skip to content

custom css upload crashes on media queries #505

@luto

Description

@luto

Expected Behavior

Any valid css should be accepted by the per-conference custom css setting/upload.

Current Behavior

@media print {
}

Uploading the above css crashes on saving:

File "pretalx/src/pretalx/orga/forms/event.py" in clean_custom_css
  42.                 validate_css(css.read())

File "pretalx/src/pretalx/common/css.py" in validate_css
  143.         style = rule.style

Exception Type: AttributeError at /orga/event/occon18/settings
Exception Value: 'CSSMediaRule' object has no attribute 'style'

Context

I tried to wip up a quick print css for #504.

Your Environment

  • Version used: master
  • Environment name and version (e.g. Chrome 39, python 3.5): N/A
  • Operating System and version (desktop or mobile): N/A
  • Link to your instance, if in production: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions