Skip to content

Commit

Permalink
mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Sep 17, 2024
1 parent 0b29846 commit edc36d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion repologyapp/template_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def url_for_static(**args: Any) -> Any:

def needs_ipv6_notice(*variants: str) -> bool:
now = datetime.datetime.now()
return now.month == 6 and now.day == 6 and ':' not in flask.request.environ.REMOTE_ADDR and flask.request.endpoint != 'index'
return now.month == 6 and now.day == 6 and ':' not in flask.request.environ['REMOTE_ADDR'] and flask.request.endpoint != 'index'
2 changes: 1 addition & 1 deletion repologyapp/template_functions_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
from repologyapp.views import registry as view_registry


def current_endpoint_group_in(**args: Any) -> str | None:
def current_endpoint_group_in(**args: Any) -> bool:
return view_registry.get_current_endpoint_group() in args['groups']
1 change: 1 addition & 0 deletions repologyapp/view_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ def register_in_flask(self, app: flask.Flask) -> None:
registrant.register_in_flask(app)

def get_current_endpoint_group(self) -> str | None:
assert flask.request.endpoint
return self._group_by_endpoint.get(flask.request.endpoint)

0 comments on commit edc36d5

Please sign in to comment.