int or str

This commit is contained in:
j 2018-06-03 13:59:35 +02:00
parent e22d5c5ad0
commit 844d25008b

View file

@ -28,6 +28,8 @@ actions.register(getIds)
def getData(request, data): def getData(request, data):
response = json_response() response = json_response()
id = data['id'] id = data['id']
if isinstance(id, int):
id = str(id)
if len(id) == 7: if len(id) == 7:
i, created = models.Imdb.objects.get_or_create(imdb=id) i, created = models.Imdb.objects.get_or_create(imdb=id)
if created: if created: