Skip to content

Commit

Permalink
[web][typing] fix last remainign mypy admonitions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasjuhrich committed Aug 24, 2023
1 parent f03941d commit 9d6e43b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion hades_logs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This module provides access to Hades' radius logs utilizing its celery
RPC api.
"""
import typing as t
import logging

from celery.exceptions import TimeoutError as CeleryTimeoutError
Expand Down Expand Up @@ -110,7 +111,9 @@ def create_task(self, name, *args, **kwargs):
full_task_name = f'{self.celery.main}.{name}'
return self.celery.signature(full_task_name, args=args, kwargs=kwargs)

def fetch_logs(self, nasipaddress: str, nasportid: str, limit=100, reduced=True):
def fetch_logs(
self, nasipaddress: str, nasportid: str, limit: int = 100, reduced: bool = True
) -> t.Iterator[RadiusLogEntry]:
"""Fetch the auth logs of the given port
:param ipaddr nasipaddress: The IP address of the NAS
Expand Down
8 changes: 4 additions & 4 deletions web/form/widgets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import wtforms_widgets
from wtforms import ValidationError
from wtforms import ValidationError, Form

from pycroft.model import session
from pycroft.model.user import User
Expand All @@ -8,15 +8,15 @@
class UserIDField(wtforms_widgets.fields.core.StringField):
"""A User-ID Field """

def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)

def __call__(self, **kwargs):
def __call__(self, **kwargs) -> None:
return super().__call__(
**kwargs
)

def pre_validate(self, form):
def pre_validate(self, form: Form) -> None:
try:
id = int(self.data)
except ValueError:
Expand Down

0 comments on commit 9d6e43b

Please sign in to comment.