Commits

Simon Meers  committed dcfc8bb

But only for strings

  • Participants
  • Parent commits eab09a3

Comments (0)

Files changed (1)

File syncr/app/flickr.py

         for field in Photo._meta.fields:
             if field.name in default_dict:
                 if hasattr(field, 'max_length'):
-                    default_dict[field.name] = \
-                        default_dict[field.name][:field.max_length]
+                    if isinstance(default_dict[field.name], basestring):
+                        default_dict[field.name] = \
+                            default_dict[field.name][:field.max_length]
 
         obj, created = Photo.objects.get_or_create(
             flickr_id = photo_xml.photo[0]['id'], defaults=default_dict)