Exemple #1
0
                         'website_name': l_company.organisation.website_name,
                     }
                 
                     organisation = Organisation(**o_kwargs)
 
                     try:
                         organisation.full_clean()
                     except ValidationError, e:
                         # Do something based on the errors contained in e.message_dict.
                         # Display them to a user, or handle them programatically.
                         print e
                     else:
                         # pass
                         # organisation.save()
                         if organisation.save():
                             organisation.organisation_type = l_org_types
                         print u'=== === === saving %s' % organisation
                 else:
                     
                     # Organisation does exist, so do any cleanups.
                     print u'=== === === exists :: cleaning %s' % organisation
                     if l_company.organisation.logo_image:
                        organisation.logo_image = os.path.join("files", "logos", os.path.basename(l_company.organisation.logo_image))
                     else:
                        organisation.logo_image = None
                        organisation.save()
             
             
                 try:
                     role_type = ProjectRoleType.objects.get(name=l_company.role)
                 except ObjectDoesNotExist: