forked from 0x2620/pandora
one more imdb id check
This commit is contained in:
parent
ec3175d885
commit
87de67be98
1 changed files with 2 additions and 1 deletions
|
@ -210,6 +210,7 @@ def download_media(item_id, url):
|
||||||
def move_media(data, user):
|
def move_media(data, user):
|
||||||
from changelog.models import add_changelog
|
from changelog.models import add_changelog
|
||||||
from item.models import get_item, Item
|
from item.models import get_item, Item
|
||||||
|
from item.utils import is_imdb_id
|
||||||
from annotation.models import Annotation
|
from annotation.models import Annotation
|
||||||
|
|
||||||
user = models.User.objects.get(username=user)
|
user = models.User.objects.get(username=user)
|
||||||
|
@ -218,7 +219,7 @@ def move_media(data, user):
|
||||||
i = Item.objects.get(public_id=data['item'])
|
i = Item.objects.get(public_id=data['item'])
|
||||||
else:
|
else:
|
||||||
data['public_id'] = data.pop('item').strip()
|
data['public_id'] = data.pop('item').strip()
|
||||||
if len(data['public_id']) != 7:
|
if not is_imdb_id(data['public_id']):
|
||||||
del data['public_id']
|
del data['public_id']
|
||||||
if 'director' in data and isinstance(data['director'], string_types):
|
if 'director' in data and isinstance(data['director'], string_types):
|
||||||
if data['director'] == '':
|
if data['director'] == '':
|
||||||
|
|
Loading…
Reference in a new issue