mirror of
https://github.com/ae-utbm/sith.git
synced 2026-09-03 19:19:19 +00:00
remove /api/markdown route
This commit is contained in:
-11
@@ -3,7 +3,6 @@ from typing import Annotated, Literal
|
|||||||
from annotated_types import Ge, Le, MinLen
|
from annotated_types import Ge, Le, MinLen
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.models import F
|
from django.db.models import F
|
||||||
from django.http import HttpResponse
|
|
||||||
from ninja import File, Query
|
from ninja import File, Query
|
||||||
from ninja.security import SessionAuth
|
from ninja.security import SessionAuth
|
||||||
from ninja_extra import ControllerBase, api_controller, paginate, route
|
from ninja_extra import ControllerBase, api_controller, paginate, route
|
||||||
@@ -18,7 +17,6 @@ from core.models import Group, QuickUploadImage, SithFile, User
|
|||||||
from core.schemas import (
|
from core.schemas import (
|
||||||
FamilyGodfatherSchema,
|
FamilyGodfatherSchema,
|
||||||
GroupSchema,
|
GroupSchema,
|
||||||
MarkdownSchema,
|
|
||||||
SithFileSchema,
|
SithFileSchema,
|
||||||
UploadedFileSchema,
|
UploadedFileSchema,
|
||||||
UploadedImage,
|
UploadedImage,
|
||||||
@@ -28,18 +26,9 @@ from core.schemas import (
|
|||||||
UserSchema,
|
UserSchema,
|
||||||
ValidationErrorSchema,
|
ValidationErrorSchema,
|
||||||
)
|
)
|
||||||
from core.templatetags.renderer import markdown
|
|
||||||
from counter.utils import is_logged_in_counter
|
from counter.utils import is_logged_in_counter
|
||||||
|
|
||||||
|
|
||||||
@api_controller("/markdown")
|
|
||||||
class MarkdownController(ControllerBase):
|
|
||||||
@route.post("", url_name="markdown")
|
|
||||||
def render_markdown(self, body: MarkdownSchema):
|
|
||||||
"""Convert the markdown text into html."""
|
|
||||||
return HttpResponse(markdown(body.text), content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
@api_controller("/upload")
|
@api_controller("/upload")
|
||||||
class UploadController(ControllerBase):
|
class UploadController(ControllerBase):
|
||||||
@route.post(
|
@route.post(
|
||||||
|
|||||||
@@ -161,10 +161,6 @@ class UserFilterSchema(FilterSchema):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
class MarkdownSchema(Schema):
|
|
||||||
text: str
|
|
||||||
|
|
||||||
|
|
||||||
class FamilyGodfatherSchema(Schema):
|
class FamilyGodfatherSchema(Schema):
|
||||||
godfather: int
|
godfather: int
|
||||||
godchild: int
|
godchild: int
|
||||||
|
|||||||
Reference in New Issue
Block a user