mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Normalize long description line endings when set by API
This commit is contained in:
parent
da090fd3f5
commit
63ad6a2b9a
@ -24,7 +24,7 @@ from flask_babel import lazy_gettext, LazyString
|
|||||||
from app.logic.LogicError import LogicError
|
from app.logic.LogicError import LogicError
|
||||||
from app.models import User, Package, PackageType, MetaPackage, Tag, ContentWarning, db, Permission, AuditSeverity, \
|
from app.models import User, Package, PackageType, MetaPackage, Tag, ContentWarning, db, Permission, AuditSeverity, \
|
||||||
License, PackageDevState
|
License, PackageDevState
|
||||||
from app.utils import add_audit_log, has_blocked_domains, diff_dictionaries, describe_difference
|
from app.utils import add_audit_log, has_blocked_domains, diff_dictionaries, describe_difference, normalize_line_endings
|
||||||
from app.utils.url import clean_youtube_url
|
from app.utils.url import clean_youtube_url
|
||||||
|
|
||||||
|
|
||||||
@ -142,6 +142,9 @@ def do_edit_package(user: User, package: Package, was_new: bool, was_web: bool,
|
|||||||
if "media_license" in data:
|
if "media_license" in data:
|
||||||
data["media_license"] = get_license(data["media_license"])
|
data["media_license"] = get_license(data["media_license"])
|
||||||
|
|
||||||
|
if "desc" in data:
|
||||||
|
data["desc"] = normalize_line_endings(data["desc"])
|
||||||
|
|
||||||
if "video_url" in data and data["video_url"] is not None:
|
if "video_url" in data and data["video_url"] is not None:
|
||||||
data["video_url"] = clean_youtube_url(data["video_url"]) or data["video_url"]
|
data["video_url"] = clean_youtube_url(data["video_url"]) or data["video_url"]
|
||||||
if "dQw4w9WgXcQ" in data["video_url"]:
|
if "dQw4w9WgXcQ" in data["video_url"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user