int or str

This commit is contained in:
j 2018-06-03 13:59:35 +02:00
parent e22d5c5ad0
commit 844d25008b
1 changed files with 2 additions and 0 deletions

View File

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