|
@ -8,8 +8,7 @@ import string |
|
|
from typing import Optional |
|
|
from typing import Optional |
|
|
|
|
|
|
|
|
from marshmallow import ValidationError |
|
|
from marshmallow import ValidationError |
|
|
from marshmallow.fields import String |
|
|
|
|
|
from marshmallow.fields import Int |
|
|
|
|
|
|
|
|
from marshmallow.fields import String, Int |
|
|
from pyramid.httpexceptions import ( |
|
|
from pyramid.httpexceptions import ( |
|
|
HTTPForbidden, |
|
|
HTTPForbidden, |
|
|
HTTPUnauthorized, |
|
|
HTTPUnauthorized, |
|
@ -273,6 +272,22 @@ def patch_change_collapse_old_comments(request: Request) -> Response: |
|
|
return IC_NOOP |
|
|
return IC_NOOP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ic_view_config( |
|
|
|
|
|
route_name="user", |
|
|
|
|
|
request_method="PATCH", |
|
|
|
|
|
request_param="ic-trigger-name=account-default-theme", |
|
|
|
|
|
permission="change_settings", |
|
|
|
|
|
) |
|
|
|
|
|
def patch_change_account_default_theme(request: Request) -> Response: |
|
|
|
|
|
"""Change the user's "theme account default" setting.""" |
|
|
|
|
|
user = request.context |
|
|
|
|
|
|
|
|
|
|
|
new_theme = request.params.get("theme") |
|
|
|
|
|
user.theme_default = new_theme |
|
|
|
|
|
|
|
|
|
|
|
return IC_NOOP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ic_view_config( |
|
|
@ic_view_config( |
|
|
route_name="user", |
|
|
route_name="user", |
|
|
request_method="PATCH", |
|
|
request_method="PATCH", |
|
@ -288,7 +303,6 @@ def patch_change_user_bio(request: Request, markdown: str) -> dict: |
|
|
|
|
|
|
|
|
return IC_NOOP |
|
|
return IC_NOOP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ic_view_config( |
|
|
@ic_view_config( |
|
|
route_name="user", |
|
|
route_name="user", |
|
|
request_method="PATCH", |
|
|
request_method="PATCH", |
|
@ -304,7 +318,6 @@ def patch_change_wpm(request: Request, words_per_minute: int) -> dict: |
|
|
|
|
|
|
|
|
return IC_NOOP |
|
|
return IC_NOOP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ic_view_config( |
|
|
@ic_view_config( |
|
|
route_name="user_invite_code", |
|
|
route_name="user_invite_code", |
|
|
request_method="GET", |
|
|
request_method="GET", |
|
|