Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (jazzband#668)
Browse files Browse the repository at this point in the history
updates:
- [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](asottile/pyupgrade@v2.37.2...v2.37.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored and 50-Course committed Oct 6, 2024
1 parent b2cbfb0 commit 1a38233
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build:
if: github.repository == 'jazzband/django-push-notifications'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
build:
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ When creating an ``APNSDevice``, the ``registration_id`` is validated to be a 64
Routes can be added one of two ways:

- Routers_ (include all views)

.. _Routers: http://www.django-rest-framework.org/tutorial/6-viewsets-and-routers#using-routers

::
Expand All @@ -327,7 +326,6 @@ Routes can be added one of two ways:
)

- Using as_view_ (specify which views to include)

.. _as_view: http://www.django-rest-framework.org/tutorial/6-viewsets-and-routers#binding-viewsets-to-urls-explicitly

::
Expand Down
2 changes: 1 addition & 1 deletion push_notifications/conf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.utils.module_loading import import_string

from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS # noqa: I001
from .app import AppConfig # noqa: F401
from .appmodel import AppModelConfig # noqa: F401
from .legacy import LegacyConfig # noqa: F401
from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS # noqa: I001


manager = None
Expand Down
3 changes: 2 additions & 1 deletion push_notifications/conf/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
PLATFORMS = [
"APNS",
"FCM",
"GCM",
"WNS",
"WP",
]
Expand Down Expand Up @@ -170,7 +171,7 @@ def _validate_apns_certificate(self, certfile):
"""Validate the APNS certificate at startup."""

try:
with open(certfile) as f:
with open(certfile, "r") as f:
content = f.read()
check_apns_certificate(content)
except Exception as e:
Expand Down
1 change: 0 additions & 1 deletion push_notifications/gcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

# Valid keys for FCM messages. Reference:
# https://firebase.google.com/docs/cloud-messaging/http-server-ref

FCM_NOTIFICATIONS_PAYLOAD_KEYS = [
"title", "body", "icon", "image", "sound", "badge", "color", "tag", "click_action",
"body_loc_key", "body_loc_args", "title_loc_key", "title_loc_args", "android_channel_id"
Expand Down
1 change: 1 addition & 0 deletions push_notifications/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import migrations, models

Expand Down
1 change: 1 addition & 0 deletions push_notifications/migrations/0002_auto_20160106_0850.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-06 08:50
from django.db import migrations, models

Expand Down
1 change: 1 addition & 0 deletions push_notifications/migrations/0003_wnsdevice.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-13 20:46
import django.db.models.deletion
from django.conf import settings
Expand Down
1 change: 1 addition & 0 deletions push_notifications/migrations/0004_fcm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-13 20:46
from django.conf import settings
from django.db import migrations, models
Expand Down
1 change: 1 addition & 0 deletions push_notifications/migrations/0005_applicationid.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import migrations, models

Expand Down
1 change: 1 addition & 0 deletions push_notifications/migrations/0006_webpushdevice.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import migrations, models

Expand Down
5 changes: 0 additions & 5 deletions push_notifications/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
)

# WP (WebPush)

PUSH_NOTIFICATIONS_SETTINGS.setdefault(
"FCM_POST_URL", "https://fcm.googleapis.com/fcm/send"
)

PUSH_NOTIFICATIONS_SETTINGS.setdefault("WP_POST_URL", {
"CHROME": PUSH_NOTIFICATIONS_SETTINGS["FCM_POST_URL"],
"OPERA": PUSH_NOTIFICATIONS_SETTINGS["FCM_POST_URL"],
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ setup_requires =
APNS =
apns2>=0.3.0
importlib-metadata;python_version < "3.8"
pywebpush>=1.3.0
Django>=2.2

WP = pywebpush>=1.3.0
Expand Down
1 change: 1 addition & 0 deletions tests/test_legacy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.test import TestCase

from push_notifications.conf import get_manager
from push_notifications.conf.legacy import LegacyConfig
from push_notifications.exceptions import WebPushError
from push_notifications.webpush import webpush_send_message

Expand Down

0 comments on commit 1a38233

Please sign in to comment.