Ignore:
Timestamp:
02/01/12 14:50:31 (12 years ago)
Author:
sil
Message:

Added exception to logger output; closes #3299

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sara_cmt/sara_cmt/django_cli.py

    r12812 r13988  
    154154            # Leave M2Ms for later, because they need an object's id
    155155            elif type(field) == ManyToManyField:
    156                 m2ms.append([field,arg_dict[arg]])
     156                m2ms.append([field, arg_dict[arg]])
    157157
    158158            self._setattr(field=arg, value=arg_dict[arg])
     
    162162            try:
    163163                self.save()
    164             except:
    165                 logger.warning('Not enough data provided')
     164            except Exception as err:
     165                logger.warning('%s: %s. Maybe not enough (unique) data provided?' % (type(err), err[-1] ))
    166166
    167167        for m2m in m2ms:
     
    246246        if isinstance(value, StringTypes):
    247247            value = [value]
    248             logger.debug("Transformed value '%s' in list '%s'"%(value[0],value))
     248            logger.debug("Transformed value '%s' in list '%s'"%(value[0], value))
    249249
    250250        # determine which fields should be searched for
     
    278278        if object_count is 0:
    279279            logger.warning('No matching object found; Change your query.')
    280             pass
    281280        elif object_count is 1:
    282281            _object = objects[0]
     
    288287            logger.warning('To many matching objects; Refine your query.')
    289288            # Try the match with the highest number of matches, ...
    290             pass
    291289
    292290    def _setm2m(self, field, values, subfields=None):
     
    356354                # like: for v in value: self.<append>(v)
    357355                logger.debug('Functionality to append values is still missing')
    358                 pass
    359356
    360357
Note: See TracChangeset for help on using the changeset viewer.