Ignore:
Timestamp:
22 May 2015, 10:12:45 (9 years ago)
Author:
Henrik Bettermann
Message:

Remove quite old bug in doImport: Replace empty strings *and* lists with
ignore-markers in update *and* create mode.

Location:
main/waeup.ikoba/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/CHANGES.txt

    r12455 r12986  
    440.2dev (unreleased)
    55===================
     6
     7* Remove quite old bug in `doImport`: Replace empty strings *and* lists with
     8  ignore-markers in update *and* create mode.
    69
    710* Update bootstrap.py and dependent package versions.
  • main/waeup.ikoba/trunk/layout/static/css/base.css

    r12804 r12986  
    165165}
    166166
    167 /* Kofa forms */
     167/* Ikoba forms */
    168168
    169169.form-table {
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/batchprocessing.txt

    r12193 r12986  
    205205    name,roles,title,public_name,phone,email,--ERRORS--
    206206    henrik,"['waeup.PortalManager', 'waeup.ImportManager']",Henrik Bettermann,Admin,+49-234-567,henrik@abc.de,This object already exists. Skipping.
    207     anne,['waeup.Nonsense'],Anne Palina,,+49-234-567,anne@abc.de,roles: invalid role
     207    anne,['waeup.Nonsense'],Anne Palina,<IGNORE>,+49-234-567,anne@abc.de,roles: invalid role
    208208
    209209    >>> finished_file = dc_path + '/finished/newusers_zope.mgr.create.finished.csv'
    210210    >>> print open(finished_file).read()
    211211    name,roles,title,public_name,phone,email
    212     isouaba,[],Issoufou Abba Moussa,Chief Developer,+49-234-567,isouaba@abc.de
     212    isouaba,<IGNORE>,Issoufou Abba Moussa,Chief Developer,+49-234-567,isouaba@abc.de
    213213
    214214The finished-file contains the dataset we could import, while the
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py

    r12812 r12986  
    289289            content,
    290290            'reg_number,password,firstname,lastname,sex,phone,state,date_of_birth,customer_id,email,--ERRORS--\r\n'
    291             '1,,Frank,Meyer,m,1234,,1990-01-06,F123456,cc@aa.ng,reg_number: Invalid input\r\n'
    292             '3,,Uli,Schulz,m,1234,,1990-01-07,A123456,dd@aa.ng,This object already exists. Skipping.\r\n'
    293             '4,,Berta,Pieri,m,1234,,1991-01-07,A234567,aa@aa.ng,email: Invalid input\r\n'
     291            '1,<IGNORE>,Frank,Meyer,m,1234,<IGNORE>,1990-01-06,F123456,cc@aa.ng,reg_number: Invalid input\r\n'
     292            '3,<IGNORE>,Uli,Schulz,m,1234,<IGNORE>,1990-01-07,A123456,dd@aa.ng,This object already exists. Skipping.\r\n'
     293            '4,<IGNORE>,Berta,Pieri,m,1234,<IGNORE>,1991-01-07,A234567,aa@aa.ng,email: Invalid input\r\n'
    294294            )
    295295        shutil.rmtree(os.path.dirname(fin_file))
     
    504504        self.assertEqual(fail_file,
    505505            'reg_number,valid_from,contract_id,title,class_name,valid_to,product_object,tc_dict,document_object,product_options,--ERRORS--\r\n'
    506             '2,,c5,,SampleContract,,SAM,,DOC1,[],This object already exists. Skipping.\r\n'
    507             '3,,c6,,SampleContract,,SAM,,NONEXISTENT,[],document_object: Invalid value\r\n'
    508             '3,,c7,,SampleContract,,NONEXISTENT,,DOC1,[],product_object: Invalid value\r\n'
     506            '2,<IGNORE>,c5,<IGNORE>,SampleContract,<IGNORE>,SAM,<IGNORE>,DOC1,<IGNORE>,This object already exists. Skipping.\r\n'
     507            '3,<IGNORE>,c6,<IGNORE>,SampleContract,<IGNORE>,SAM,<IGNORE>,NONEXISTENT,<IGNORE>,document_object: Invalid value\r\n'
     508            '3,<IGNORE>,c7,<IGNORE>,SampleContract,<IGNORE>,NONEXISTENT,<IGNORE>,DOC1,<IGNORE>,product_object: Invalid value\r\n'
    509509            )
    510510        contract = self.processor.getEntry(dict(reg_number='1',
     
    529529        self.assertTrue(
    530530            'INFO - system - Customer Sample Contract Processor - sample_contract_data - '
    531             'X666666 - %s - updated: valid_from=, title=, valid_to=, product_object=SAM, tc_dict=, document_object=DOC1, '
    532             'product_options=[]' % conid
     531            'X666666 - %s - updated: product_object=SAM, document_object=DOC1'
     532            % conid
    533533            in logcontent)
    534534
  • main/waeup.ikoba/trunk/src/waeup/ikoba/permissions.txt

    r12764 r12986  
    3939    >>> from waeup.ikoba.permissions import get_waeup_roles
    4040    >>> len(list(get_waeup_roles()))
    41     17
     41    18
    4242
    4343    >>> len(list(get_waeup_roles(also_local=True)))
    44     21
     44    22
    4545
    4646
     
    6767    u'waeup.ProductsManager',
    6868    u'waeup.ProductsOfficer',
     69    u'waeup.ReportsManager',
    6970    u'waeup.UsersManager',
    7071    u'waeup.WorkflowManager',
  • main/waeup.ikoba/trunk/src/waeup/ikoba/reports.py

    r11949 r12986  
    139139    """
    140140
    141 class manageReportsPermission(grok.Permission):
    142     """A permission to manage reports.
     141class ManageReports(grok.Permission):
     142    """The ManageReports permission allows to view, add and remove reports.
    143143    """
    144144    grok.name('waeup.manageReports')
     145
     146class ReportsManager(grok.Role):
     147    """The ReportsManager has the permission to manage reports.
     148    """
     149    grok.name('waeup.ReportsManager')
     150    grok.title(u'Reports Manager')
     151    grok.permissions('waeup.manageReports')
    145152
    146153def get_generators():
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/batching.py

    r12812 r12986  
    320320                continue
    321321            string_row = self.applyMapping(raw_row, mapping)
    322             if ignore_empty and mode in ('update',):
    323                 # replace empty strings with ignore-markers
    324                 for key, val in string_row.items():
    325                     if val == '':
    326                         string_row[key] = IGNORE_MARKER
     322            if ignore_empty:
     323                  # Replace empty strings and empty lists with ignore-markers
     324                  for key, val in string_row.items():
     325                      if val == '' or val == '[]':
     326                          string_row[key] = IGNORE_MARKER
    327327            row = dict(string_row.items()) # create deep copy
    328328            errs, inv_errs, conv_dict = self.checkConversion(string_row, mode)
Note: See TracChangeset for help on using the changeset viewer.