Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django field for Quill input #655

Merged
merged 18 commits into from
Sep 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions hawc/apps/common/validators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
from typing import Sequence
from typing import Optional, Sequence
from urllib import parse

import bleach
Expand Down Expand Up @@ -36,12 +36,13 @@
valid_css_properties = {"color", "background-color"}
valid_scheme = {"", "http", "https"}
valid_netloc_endings = {
".gov",
".edu",
".gov",
".who.int",
"sciencedirect.com",
"doi.org",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also added doi.org as a valid URL

"elsevier.com",
"public.tableau.com",
"sciencedirect.com",
}


Expand All @@ -67,7 +68,7 @@ def clean_html(html: str) -> str:
)


def validate_html_tags(html: str, field: str = None) -> str:
def validate_html_tags(html: str, field: Optional[str] = None) -> str:
"""Html contains a subset of acceptable tags.

Args:
Expand Down