Skip to content

Commit

Permalink
Fixed flake8 errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonye Jack committed Aug 15, 2020
1 parent f1cd05a commit 07a4419
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions model_subscription/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from django.conf import settings

from model_subscription.models import SubscriptionModel
from model_subscription.constants import OperationType
from model_subscription.types import T

Expand Down Expand Up @@ -63,7 +64,7 @@ def my_custom_delete_receiver(instance)


def subscribe(operation, model):
# type: (OperationType, 'SubscriptionModel') -> Callable[[T], None]
# type: (OperationType, SubscriptionModel) -> Callable[[T], None]
def _decorator(func):
model._subscription.attach(operation, func)
return func
Expand All @@ -79,7 +80,7 @@ def _decorator(func):


def unsubscribe(operation, model, func=None):
# type: (OperationType, 'SubscriptionModel', Optional[Callable[[T], Any]]) -> Callable[[T], Any]
# type: (OperationType, SubscriptionModel, Optional[Callable[[T], Any]]) -> Callable[[T], Any]

if func is not None:
model._subscription.detach(operation, func)
Expand Down
3 changes: 2 additions & 1 deletion model_subscription/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.utils.module_loading import autodiscover_modules

from model_subscription.constants import OperationType
from model_subscription.mixin import SubscriptionModelMixin
from model_subscription.observers import (
Observer, CreateObserver, UpdateObserver, DeleteObserver,
BulkCreateObserver, BulkUpdateObserver, BulkDeleteObserver
Expand Down Expand Up @@ -96,7 +97,7 @@ def auto_discover():
autodiscover_modules(settings.SUBSCRIPTION_MODULE)

def notify(self, operation_type, instance):
# type: (Union[OperationType.CREATE, OperationType.UPDATE, OperationType.DELETE], Type['SubscriptionModelMixin']) -> None
# type: (Union[OperationType.CREATE, OperationType.UPDATE, OperationType.DELETE], Type[SubscriptionModelMixin]) -> None
self.subscription_model = instance
observer = self.observers[operation_type]

Expand Down

0 comments on commit 07a4419

Please sign in to comment.