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
def get_state(data):
states = {
'new': News.PUBLISHED,
'new': News.WAITING,
'published': News.PUBLISHED,
'hidden': News.HIDDEN,
'published_exclusive': News.PUBLISHED_EXCLUSIVE,
'scheduled_exclusively': News.WAITING,
}
return states.get(data['state'], News.WAITING)