Skip to content

Commit

Permalink
apply black linter
Browse files Browse the repository at this point in the history
  • Loading branch information
HesamKorki committed Oct 23, 2023
1 parent 18ae302 commit 7092209
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion elixir_daisy/celery_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
# The uppercase name-space means that all Celery configuration options must
# be specified in uppercase instead of lowercase, and start with CELERY_,
# be specified in uppercase instead of lowercase, and start with CELERY_,
# so for example the task_always_eager setting becomes CELERY_TASK_ALWAYS_EAGER,

app.config_from_object("django.conf:settings", namespace="CELERY")
Expand Down
18 changes: 11 additions & 7 deletions notification/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
class NotifyMixin:
def get_notification_recipients(self):
"""
Should Query the users based on their notification settings
Should Query the users based on their notification settings
and the entity.
Raises:
NotImplementedError: It should be implemented by the subclass
"""
raise NotImplementedError(f"Subclasses of {NotifyMixin.__name__} must implement {self.get_notification_recipients.__name__}")

raise NotImplementedError(
f"Subclasses of {NotifyMixin.__name__} must implement {self.get_notification_recipients.__name__}"
)

def make_notification(self):
"""
Creates a notifications for the reciepients based on
Creates a notifications for the reciepients based on
the business logic of the entity.
Raises:
NotImplementedError: It should be implemented by the subclass
"""
raise NotImplementedError(f"Subclasses of {NotifyMixin.__name__} must implement {self.make_notification.__name__}")

raise NotImplementedError(
f"Subclasses of {NotifyMixin.__name__} must implement {self.make_notification.__name__}"
)

def get_absolute_url(self):
"""
Returns the absolute url of the entity.
"""
return None
return None
4 changes: 4 additions & 0 deletions notification/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
NotificationStyle.once_per_month: timedelta(days=33),
}


@shared_task
def create_notifications_for_entities():
"""
Expand All @@ -27,8 +28,11 @@ def create_notifications_for_entities():
"""
now = timezone.now()

# Get all the users that are local custodians of a contract

pass


@shared_task
def send_notifications_for_user_by_time(user_id, time):
"""
Expand Down

0 comments on commit 7092209

Please sign in to comment.