width/height
This commit is contained in:
parent
254ad03382
commit
3417eb9281
2 changed files with 11 additions and 5 deletions
|
@ -718,6 +718,11 @@ class Item(models.Model):
|
||||||
if videos.count() > 0:
|
if videos.count() > 0:
|
||||||
s.duration = sum([v.duration for v in videos])
|
s.duration = sum([v.duration for v in videos])
|
||||||
v = videos[0]
|
v = videos[0]
|
||||||
|
if v.is_audio:
|
||||||
|
s.resolution = None
|
||||||
|
s.width = None
|
||||||
|
s.height = None
|
||||||
|
else:
|
||||||
s.resolution = v.width * v.height
|
s.resolution = v.width * v.height
|
||||||
s.width = v.width
|
s.width = v.width
|
||||||
s.height = v.height
|
s.height = v.height
|
||||||
|
|
|
@ -18,6 +18,7 @@ def monkey_patch_username():
|
||||||
for v in f.validators:
|
for v in f.validators:
|
||||||
if isinstance(v, MaxLengthValidator):
|
if isinstance(v, MaxLengthValidator):
|
||||||
v.limit_value = NEW_LENGTH[field]
|
v.limit_value = NEW_LENGTH[field]
|
||||||
|
|
||||||
f = Group._meta.get_field('name')
|
f = Group._meta.get_field('name')
|
||||||
f.max_length = 255
|
f.max_length = 255
|
||||||
for v in f.validators:
|
for v in f.validators:
|
||||||
|
|
Loading…
Reference in a new issue