fix typo
This commit is contained in:
parent
cbad99e3ac
commit
804164833a
|
|
@ -741,8 +741,8 @@ class MenuFilesSerializers(ProjectModelSerializer):
|
|||
def validate(self, attrs):
|
||||
extension = attrs['file'].name.split('.')[-1]
|
||||
attrs['type'] = 'image' if extension in ('jpg', 'jpeg', 'png') else 'file'
|
||||
if not attrs['name']:
|
||||
attrs['mame'] = attrs['file'].name
|
||||
if 'name' not in attrs or not attrs['name']:
|
||||
attrs['name'] = attrs['file'].name
|
||||
return attrs
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user