mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
zerver: Migrate several small files to typed_endpoint.
Migrate "submessage.py", "thumbnail.py", "tutorial.py", "zephyr.py" and "dev_login.py" to `typed_endpoint`.
This commit is contained in:
committed by
Tim Abbott
parent
defd6748d6
commit
fe2097fd26
@@ -1,15 +1,16 @@
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from typing_extensions import Literal
|
||||
|
||||
from zerver.decorator import human_users_only
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.typed_endpoint import typed_endpoint
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
||||
@human_users_only
|
||||
@has_request_variables
|
||||
@typed_endpoint
|
||||
def set_tutorial_status(
|
||||
request: HttpRequest, user_profile: UserProfile, status: str = REQ()
|
||||
request: HttpRequest, user_profile: UserProfile, *, status: Literal["started", "finished"]
|
||||
) -> HttpResponse:
|
||||
if status == "started":
|
||||
user_profile.tutorial_status = UserProfile.TUTORIAL_STARTED
|
||||
|
||||
Reference in New Issue
Block a user