states dict fix
This commit is contained in:
parent
5826fb2475
commit
6335abe1ea
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user