Skip to content

Commit

Permalink
fix flake and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
devketanpro committed Jul 17, 2024
1 parent 47db0c0 commit 3efe395
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
4 changes: 1 addition & 3 deletions newsroom/am_news/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from flask import current_app as app
from eve.render import send_response
from eve.methods.get import get_internal
from superdesk import get_resource_service

from newsroom.am_news import blueprint
from newsroom.auth import get_user, get_user_id
Expand Down Expand Up @@ -106,8 +105,7 @@ async def item(_id):
item = get_entity_or_404(_id, "items")
set_permissions(item, "am_news")
ui_config_service = UiConfigResourceService()
am_news = await ui_config_service.get_section_config("am_news")
display_char_count = am_news.get("char_count", False)
display_char_count = await ui_config_service.get_section_config("am_news").get("char_count", False)
if is_json_request(flask.request):
return flask.jsonify(item)
if not item.get("_access"):
Expand Down
1 change: 0 additions & 1 deletion newsroom/factcheck/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from eve.render import send_response
from eve.methods.get import get_internal

from superdesk import get_resource_service
from newsroom.factcheck import blueprint
from newsroom.auth import get_user, get_user_id
from newsroom.decorator import login_required, section
Expand Down
1 change: 0 additions & 1 deletion newsroom/media_releases/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from flask import current_app as app
from eve.render import send_response
from eve.methods.get import get_internal
from superdesk import get_resource_service

from newsroom.media_releases import blueprint
from newsroom.auth import get_user, get_user_id
Expand Down
1 change: 0 additions & 1 deletion newsroom/public/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from werkzeug.utils import secure_filename
from flask import render_template, current_app as app

from superdesk import get_resource_service
from newsroom.auth.utils import is_valid_session

from newsroom.types import DashboardCard, Article
Expand Down
12 changes: 6 additions & 6 deletions newsroom/ui_config_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class UiConfig(ResourceModel):
details: Optional[Dict[str, Any]] = None
list: Optional[Dict[str, Any]] = None
advanced_search_tabs: Optional[Dict[str, Any]] = None
multi_select_topics: bool = None
search: bool = None
enable_global_topics: bool = None
open_coverage_content_in_same_page: bool = None
subnav: Dict[str, Any] = None
init_version: int = None
multi_select_topics: Optional[bool] = None
search: Optional[bool] = None
enable_global_topics: Optional[bool] = None
open_coverage_content_in_same_page: Optional[bool] = None
subnav: Optional[Dict[str, Any]] = None
init_version: Optional[int] = None


class UiConfigResourceService(AsyncResourceService[UiConfig]):
Expand Down

0 comments on commit 3efe395

Please sign in to comment.