Ticket #3765: patch.diff

File patch.diff, 750 bytes (added by dswistowski@…, 18 years ago)
  • django/db/models/fields/__init__.py

     
    286286        field's data.
    287287        """
    288288        if rel:
    289             return new_data.get(self.name, [self.get_default()])[0]
     289            new_data_getted = new_data.get(self.name, [self.get_default()])
     290            if(isinstance(new_data_getted, list)):
     291                return new_data_getted[0]
     292            else:
     293                return new_data_getted
    290294        val = new_data.get(self.name, self.get_default())
    291295        if not self.empty_strings_allowed and val == '' and self.null:
    292296            val = None
Back to Top