Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ repos:

- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.3
rev: 0.11.32
hooks:
# Update the uv lockfile
- id: uv-lock

- repo: https://github.com/adamchainz/django-upgrade
rev: "1.29.1"
rev: "1.31.1"
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]
Expand All @@ -37,7 +37,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.6
rev: v0.16.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
2 changes: 1 addition & 1 deletion bigredbutton/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BigRedButtonConfig(AppConfig):
@register()
def check_session_engine(app_configs, **kwargs):
errors = []
if session_engine := getattr(settings, "SESSION_ENGINE"):
if session_engine := settings.SESSION_ENGINE:
engine_name = session_engine.split('.')[0]
engine = Engine.get_default()
try:
Expand Down
13 changes: 5 additions & 8 deletions bigredbutton/templatetags/user_agent_str.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from typing import Optional

from user_agents.parsers import Browser, Device, OperatingSystem, UserAgent

from django import template
from django.utils.translation import gettext_lazy as _

from user_agents.parsers import Browser, Device, OperatingSystem, UserAgent

register = template.Library()

Expand All @@ -13,7 +10,7 @@ def ua_str(
ua: str | UserAgent,
include_os: bool = False,
include_versions: bool = False,
) -> Optional[str]:
) -> str | None:
"""
Return a human-readable string that summarizes a user agent from python-user-agents
"""
Expand Down Expand Up @@ -46,7 +43,7 @@ def ua_str(
def ua_browser(
ua_browser: Browser,
include_version: bool = False,
) -> Optional[str]:
) -> str | None:
"""
Return a human-readable string that summarizes the browser from a user agent
"""
Expand All @@ -64,7 +61,7 @@ def ua_browser(
def ua_os(
ua_os: OperatingSystem,
include_version: bool = False,
) -> Optional[str]:
) -> str | None:
if include_version and ua_os.version_string:
return _("{os} {version}").format(
os=ua_os.family,
Expand All @@ -78,7 +75,7 @@ def ua_os(
@register.simple_tag(name="ua_device")
def ua_device(
ua_device: Device,
) -> Optional[str]:
) -> str | None:
if ua_device.brand and ua_device.model:
return _("{brand} {model}").format(
brand=ua_device.brand,
Expand Down
1 change: 0 additions & 1 deletion bigredbutton/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
SessionList,
)


urlpatterns = [
path('', SessionList.as_view(), name='list_sessions'),
path('delete/others/', SessionDelete.as_view(), name='delete_other_sessions'),
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from pathlib import Path
import os
import sys
from pathlib import Path

if __name__ == "__main__":
sys.path.insert(0, Path(__file__).resolve())
Expand Down
2 changes: 1 addition & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from datetime import timedelta

from django.contrib.auth.models import User
from django.test import Client, TestCase
from django.urls import reverse
from django.utils.timezone import now
from django.test import Client, TestCase


class ViewsTest(TestCase):
Expand Down
1 change: 0 additions & 1 deletion tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.urls import include, path


urlpatterns = [
path("", include('bigredbutton.urls')),
]
Loading