states dict fix

This commit is contained in:
alex 2019-10-24 15:24:31 +03:00
parent 5826fb2475
commit 6335abe1ea

View File

@ -50,9 +50,11 @@ class NewsSerializer(serializers.ModelSerializer):
@staticmethod @staticmethod
def get_state(data): def get_state(data):
states = { states = {
'new': News.PUBLISHED, 'new': News.WAITING,
'published': News.PUBLISHED, 'published': News.PUBLISHED,
'hidden': News.HIDDEN, 'hidden': News.HIDDEN,
'published_exclusive': News.PUBLISHED_EXCLUSIVE,
'scheduled_exclusively': News.WAITING,
} }
return states.get(data['state'], News.WAITING) return states.get(data['state'], News.WAITING)