-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,125 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
release: ./release-tasks.sh | ||
web: gunicorn authors.wsgi —-log-file - | ||
release: ./release-tasks.sh | ||
web: gunicorn authors.wsgi —-log-file - | ||
worker: python manage.py qcluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
|
||
class FavouriteConfig(AppConfig): | ||
name = 'favourite' | ||
name = 'authors.apps.favourite' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class NotificationsConfig(AppConfig): | ||
name = 'authors.apps.notifier' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.db import models | ||
|
||
|
||
# Create your models here. | ||
|
||
class MailingList(models.Model): | ||
"""A table containing users who receive email notifier""" | ||
user = models.ForeignKey(get_user_model(), | ||
on_delete=models.CASCADE, | ||
) | ||
# The status of the user with regards to receiving notifier | ||
email_notifications = models.BooleanField(default=True) | ||
push_notifications = models.BooleanField(default=True) | ||
|
||
def is_email_subscribed(user): | ||
""" | ||
Verify that a user is subscribed to receive email notifier | ||
:param user: | ||
:return bool: | ||
""" | ||
obj = MailingList.objects.get_or_create( | ||
user=user) | ||
return obj[0].email_notifications | ||
|
||
def is_push_subscribed(user): | ||
""" | ||
Verify that a user is subscribed to receive push notifier | ||
:param user: | ||
:return bool: | ||
""" | ||
obj = MailingList.objects.get_or_create( | ||
user=user) | ||
return obj[0].push_notifications |
Oops, something went wrong.