change news states
This commit is contained in:
parent
2eeb67e10f
commit
ce9aa30074
|
|
@ -69,7 +69,6 @@ def send_team_invite_to_existing_user(user_id, country_code, user_role_id, resta
|
|||
f'DETAIL: Exception occurred for user: {user_id}')
|
||||
|
||||
|
||||
|
||||
@shared_task
|
||||
def team_role_revoked(user_id, country_code, restaurant_name):
|
||||
"""Send email to establishment team member with role acceptance link"""
|
||||
|
|
|
|||
18
apps/news/migrations/0056_auto_20200205_1310.py
Normal file
18
apps/news/migrations/0056_auto_20200205_1310.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.7 on 2020-02-05 13:10
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('news', '0055_auto_20200131_1232'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='news',
|
||||
name='state',
|
||||
field=models.PositiveSmallIntegerField(choices=[(0, 'published'), (1, 'not published')], default=1, verbose_name='State'),
|
||||
),
|
||||
]
|
||||
|
|
@ -278,16 +278,12 @@ class News(GalleryMixin, BaseAttributes, TranslatedFieldsMixin, HasTagsMixin,
|
|||
)
|
||||
|
||||
# STATE CHOICES
|
||||
REMOVE = 0
|
||||
HIDDEN = 1
|
||||
PUBLISHED = 2
|
||||
UNPUBLISHED = 3
|
||||
PUBLISHED = 0
|
||||
UNPUBLISHED = 1
|
||||
|
||||
PUBLISHED_STATES = [PUBLISHED]
|
||||
|
||||
STATE_CHOICES = (
|
||||
(REMOVE, _('remove')), # simply stored in DB news. not shown anywhere
|
||||
(HIDDEN, _('hidden')), # not shown in api/web or api/mobile
|
||||
(PUBLISHED, _('published')), # shown everywhere
|
||||
(UNPUBLISHED, _('not published')), # newly created news
|
||||
)
|
||||
|
|
|
|||
|
|
@ -92,9 +92,9 @@ class NewsSerializer(serializers.Serializer):
|
|||
states = {
|
||||
'new': News.UNPUBLISHED,
|
||||
'published': News.PUBLISHED,
|
||||
'hidden': News.HIDDEN,
|
||||
'published_exclusive': News.PUBLISHED,
|
||||
'scheduled_exclusively': News.PUBLISHED,
|
||||
'hidden': News.UNPUBLISHED,
|
||||
'published_exclusive': News.UNPUBLISHED,
|
||||
'scheduled_exclusively': News.UNPUBLISHED,
|
||||
}
|
||||
return states.get(data['page__state'], News.UNPUBLISHED)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user