helping hand representation

This commit is contained in:
Kuroshini 2019-12-31 01:22:45 +03:00
parent af8febbe45
commit 7edd836a75
5 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,8 @@ def send_email_with_news(news_ids):
for subscriber in subscribers:
socials_for_subscriber = socials.get(subscriber.country_code)
try:
# TODO: вот тут надо учесть, подписки на какие страны есть у юзера активные (нулл время отписки) и не посылать лишнего
# TODO: обрати внимание на кол-во запросов в БД плс. они пишутся в консоль
for new in sent_news:
context = {
"title": new.title.get(subscriber.locale),

View File

@ -15,6 +15,7 @@ class SubscriptionType(ProjectBaseMixin, TranslatedFieldsMixin):
name = TJSONField(blank=True, null=True, default=None,
verbose_name=_('name'),
help_text='{"en-GB":"some text"}')
# TODO: не хватает связи со страной. ForeignKey
# todo: associate user & subscriber after users registration

View File

@ -0,0 +1 @@
urlpatterns = []

View File

@ -28,6 +28,7 @@ class SubscribeInfoView(generics.RetrieveAPIView):
class SubscribeInfoAuthUserView(generics.ListAPIView):
"""Subscribe info auth user view."""
# TODO: тут пользователь должен видеть свои подписки. проверь плс, что работает
permission_classes = (permissions.IsAuthenticated,)
serializer_class = serializers.SubscribeSerializer

View File

@ -10,6 +10,7 @@ urlpatterns = [
path('gallery/', include(('gallery.urls', 'gallery'), namespace='gallery')),
path('location/', include('location.urls.back')),
path('news/', include('news.urls.back')),
path('notifications/', include(('notification.urls.back', 'notification'), namespace='notification')),
path('review/', include('review.urls.back')),
path('tags/', include(('tag.urls.back', 'tag'), namespace='tag')),
path('products/', include(('product.urls.back', 'product'), namespace='product')),