-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from Instanssi/nh3-html-field
NH3 html field
- Loading branch information
Showing
75 changed files
with
944 additions
and
912 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import Any | ||
|
||
import nh3 | ||
from django.db.models import TextField | ||
|
||
|
||
class SanitizedHtmlField(TextField): | ||
def to_python(self, value: Any) -> str | None: | ||
if value := super().to_python(value): | ||
value = nh3.clean(value) | ||
return value |
20 changes: 20 additions & 0 deletions
20
backend/Instanssi/ext_blog/migrations/0007_alter_blogentry_text.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 5.0.3 on 2024-04-01 22:05 | ||
|
||
from django.db import migrations | ||
|
||
import Instanssi.common.html.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("ext_blog", "0006_alter_blogentry_date"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="blogentry", | ||
name="text", | ||
field=Instanssi.common.html.fields.SanitizedHtmlField(verbose_name="Teksti"), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
backend/Instanssi/management/site/assets/BlogEditorView-DAYpdJ6R.js
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-68.9 KB
backend/Instanssi/management/site/assets/BlogEditorView-DAYpdJ6R.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion
1
backend/Instanssi/management/site/assets/BlogEditorView-DAYpdJ6R.js.map
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-198 KB
backend/Instanssi/management/site/assets/BlogEditorView-DAYpdJ6R.js.map.gz
Binary file not shown.
55 changes: 55 additions & 0 deletions
55
backend/Instanssi/management/site/assets/BlogView-B2-Dt3Bh.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
backend/Instanssi/management/site/assets/BlogView-B2-Dt3Bh.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
2 changes: 0 additions & 2 deletions
2
backend/Instanssi/management/site/assets/EventView-B31VrPUd.js
This file was deleted.
Oops, something went wrong.
Binary file not shown.
1 change: 0 additions & 1 deletion
1
backend/Instanssi/management/site/assets/EventView-B31VrPUd.js.map
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-3.57 KB
backend/Instanssi/management/site/assets/EventView-B31VrPUd.js.map.gz
Binary file not shown.
Oops, something went wrong.