Merge branch 'feature/news-subscription' into develop
This commit is contained in:
commit
0f8cf72cd8
|
|
@ -26,6 +26,8 @@ def send_email_with_news(news_ids):
|
||||||
for subscriber in subscribers:
|
for subscriber in subscribers:
|
||||||
socials_for_subscriber = socials.get(subscriber.country_code)
|
socials_for_subscriber = socials.get(subscriber.country_code)
|
||||||
try:
|
try:
|
||||||
|
# TODO: вот тут надо учесть, подписки на какие страны есть у юзера активные (нулл время отписки) и не посылать лишнего
|
||||||
|
# TODO: обрати внимание на кол-во запросов в БД плс. они пишутся в консоль
|
||||||
for new in sent_news:
|
for new in sent_news:
|
||||||
context = {
|
context = {
|
||||||
"title": new.title.get(subscriber.locale),
|
"title": new.title.get(subscriber.locale),
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ class SubscriptionType(ProjectBaseMixin, TranslatedFieldsMixin):
|
||||||
name = TJSONField(blank=True, null=True, default=None,
|
name = TJSONField(blank=True, null=True, default=None,
|
||||||
verbose_name=_('name'),
|
verbose_name=_('name'),
|
||||||
help_text='{"en-GB":"some text"}')
|
help_text='{"en-GB":"some text"}')
|
||||||
|
# TODO: не хватает связи со страной. ForeignKey
|
||||||
|
|
||||||
|
|
||||||
# todo: associate user & subscriber after users registration
|
# todo: associate user & subscriber after users registration
|
||||||
|
|
|
||||||
1
apps/notification/urls/back.py
Normal file
1
apps/notification/urls/back.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
urlpatterns = []
|
||||||
|
|
@ -28,6 +28,7 @@ class SubscribeInfoView(generics.RetrieveAPIView):
|
||||||
class SubscribeInfoAuthUserView(generics.ListAPIView):
|
class SubscribeInfoAuthUserView(generics.ListAPIView):
|
||||||
"""Subscribe info auth user view."""
|
"""Subscribe info auth user view."""
|
||||||
|
|
||||||
|
# TODO: тут пользователь должен видеть свои подписки. проверь плс, что работает
|
||||||
permission_classes = (permissions.IsAuthenticated,)
|
permission_classes = (permissions.IsAuthenticated,)
|
||||||
serializer_class = serializers.SubscribeSerializer
|
serializer_class = serializers.SubscribeSerializer
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ urlpatterns = [
|
||||||
path('gallery/', include(('gallery.urls', 'gallery'), namespace='gallery')),
|
path('gallery/', include(('gallery.urls', 'gallery'), namespace='gallery')),
|
||||||
path('location/', include('location.urls.back')),
|
path('location/', include('location.urls.back')),
|
||||||
path('news/', include('news.urls.back')),
|
path('news/', include('news.urls.back')),
|
||||||
|
path('notifications/', include(('notification.urls.back', 'notification'), namespace='notification')),
|
||||||
path('review/', include('review.urls.back')),
|
path('review/', include('review.urls.back')),
|
||||||
path('tags/', include(('tag.urls.back', 'tag'), namespace='tag')),
|
path('tags/', include(('tag.urls.back', 'tag'), namespace='tag')),
|
||||||
path('products/', include(('product.urls.back', 'product'), namespace='product')),
|
path('products/', include(('product.urls.back', 'product'), namespace='product')),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user