Changeset 6470


Ignore:
Timestamp:
23 Jun 2011, 12:31:09 (13 years ago)
Author:
Henrik Bettermann
Message:

It should always be workflow state not status. My mistake.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py

    r6458 r6470  
    5252
    5353    @property
    54     def status(self):
     54    def state(self):
    5555        return IWorkflowState(self).getState()
    5656
     
    166166            )
    167167        writer = csv.writer(open(csv_path, 'w'), quoting=csv.QUOTE_ALL)
    168         writer.writerow(['prefix', 'serial', 'ac', 'status', 'history'])
     168        writer.writerow(['prefix', 'serial', 'ac', 'state', 'history'])
    169169        writer.writerow([self.prefix, '%0.2f' % self.cost, str(self.num),
    170170                         str(self.entry_num)])
     
    175175            writer.writerow([
    176176                    self.prefix, value.batch_serial, value.representation,
    177                     value.status, value.history
     177                    value.state, value.history
    178178                    ])
    179179        return os.path.basename(csv_path)
     
    251251
    252252    # This is temporary reimport solution. Access codes will be imported
    253     # with status initialized no matter if they have been used before.
     253    # with state initialized no matter if they have been used before.
    254254    def reimport(self, filename, creator=u'UNKNOWN'):
    255255        """Reimport a batch given in CSV file.
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.txt

    r6454 r6470  
    306306    ...                             sorted(os.listdir(ac_storage))[-2])
    307307    >>> print open(archive_file, 'rb').read()
    308     "prefix","serial","ac","status","history"
     308    "prefix","serial","ac","state","history"
    309309    "BLA","19.12","1","3"
    310310    "BLA","0","BLA-1-<10-DIGITS>","initialized","..."
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser_templates/searchpage.pt

    r6460 r6470  
    2525        <tr>
    2626          <th>&nbsp;</th>
    27           <th width="50px">Serial</th><th>AC</th><th>Status</th><th>History</th>
     27          <th width="50px">Serial</th><th>AC</th><th>State</th><th>History</th>
    2828        </tr>
    2929      </thead>
     
    3434          <td tal:content="item/batch_serial">1</td>
    3535          <td tal:content="item/code">APP-1-1234567890</td>
    36           <td tal:content="item/status">unused</td>
     36          <td tal:content="item/state">unused</td>
    3737          <td tal:content="structure python:item.history.replace('||','<br />')">
    3838            history
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/catalog.py

    r6452 r6470  
    1818    history = grok.index.Text(attribute='history')
    1919    batch_serial = grok.index.Field(attribute='batch_serial')
    20     status = grok.index.Field(attribute='status')
     20    state = grok.index.Field(attribute='state')
    2121
    2222class AccessCodeQueryResultItem(object):
     
    2828        self.code = context.representation
    2929        self.history = context.history
    30         self.status = context.status
     30        self.state = context.state
    3131        self.batch_serial = context.batch_serial
    3232
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py

    r6452 r6470  
    2424        default = 0.0, min = 0.0,
    2525        )
    26     status = schema.TextLine(
    27         title = u'Workflow status',
     26    state = schema.TextLine(
     27        title = u'Workflow state',
    2828        )
    2929    representation = schema.TextLine(
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py

    r6459 r6470  
    106106
    107107    def test_invalidate_accesscode(self):
    108         assert self.ac1.status != USED
     108        assert self.ac1.state != USED
    109109        result = invalidate_accesscode('APP-1-11111111')
    110         assert self.ac1.status == USED
     110        assert self.ac1.state == USED
    111111        assert result is True
    112112
    113113    def test_disable_accesscode_unused(self):
    114114        # we can disable initialized acs
    115         assert self.ac1.status != USED
     115        assert self.ac1.state != USED
    116116        disable_accesscode('APP-1-11111111')
    117         assert self.ac1.status == DISABLED
     117        assert self.ac1.state == DISABLED
    118118
    119119    def test_disable_accesscode_used(self):
    120120        # we can disable already used acs
    121         assert self.ac1.status != DISABLED
     121        assert self.ac1.state != DISABLED
    122122        invalidate_accesscode('APP-1-11111111')
    123123        disable_accesscode('APP-1-11111111')
    124         assert self.ac1.status == DISABLED
     124        assert self.ac1.state == DISABLED
    125125
    126126    def test_reenable_accesscode(self):
     
    129129        result = reenable_accesscode('APP-1-11111111')
    130130        assert result is True
    131         assert self.ac1.status != USED
     131        assert self.ac1.state != USED
    132132
    133133    def test_fire_transition(self):
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py

    r6452 r6470  
    110110        # Now we want to find the disabled access code
    111111        cat = queryUtility(ICatalog, name='accesscodes_catalog')
    112         results1 = cat.searchResults(status=('disabled', 'disabled'))
    113         results2 = cat.searchResults(status=('initialized', 'initialized'))
     112        results1 = cat.searchResults(state=('disabled', 'disabled'))
     113        results2 = cat.searchResults(state=('initialized', 'initialized'))
    114114        results1 = [x for x in results1] # Turn results generator into list
    115115        # We found 1 accescode disabled
     
    125125        # Now we want to find the invalidated access code
    126126        cat = queryUtility(ICatalog, name='accesscodes_catalog')
    127         results1 = cat.searchResults(status=('used', 'used'))
    128         results2 = cat.searchResults(status=('initialized', 'initialized'))
     127        results1 = cat.searchResults(state=('used', 'used'))
     128        results2 = cat.searchResults(state=('initialized', 'initialized'))
    129129        results1 = [x for x in results1] # Turn results generator into list
    130130        # We found 1 accescode used
     
    145145        # exactly one access code.
    146146        results = cat.searchResults(history='Tester',
    147                                     status=('used', 'used'),
     147                                    state=('used', 'used'),
    148148                                    code=('APP-1-11111111', 'APP-1-22222222'))
    149149        assert len(results) == 1
     
    154154        # immediately in catalog
    155155        cat = queryUtility(ICatalog, name='accesscodes_catalog')
    156         result = cat.searchResults(status=('used', 'used'))
     156        result = cat.searchResults(state=('used', 'used'))
    157157        assert len(result) == 0
    158158        invalidate_accesscode('APP-1-11111111')
    159         result = cat.searchResults(status=('used', 'used'))
     159        result = cat.searchResults(state=('used', 'used'))
    160160        assert len(result) == 1
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/authentication.py

    r6465 r6470  
    228228        if ac is None:
    229229            return None
    230         if ac.status == 'disabled':
    231             return None
    232         if ac.status == 'used' and appl_ac != ac.representation:
     230        if ac.state == 'disabled':
     231            return None
     232        if ac.state == 'used' and appl_ac != ac.representation:
    233233            return None
    234234        if appl_ac is not None and appl_ac != ac.representation:
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6469 r6470  
    426426
    427427        # Mark pin as used (this also fires a pin related transition)
    428         if get_access_code(pin).status == USED:
     428        if get_access_code(pin).state == USED:
    429429            pass
    430430        else:
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt

    r6461 r6470  
    6565            <th>ID
    6666            </th>
    67             <th>status
     67            <th>state
    6868            </th>
    6969          </tr>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py

    r6452 r6470  
    5050
    5151class FakeAccessCode(object):
    52     def __init__(self, repr, status = 'initialized'):
     52    def __init__(self, repr, state = 'initialized'):
    5353        self.representation = repr
    54         self.status = status
     54        self.state = state
    5555
    5656class FakeApplication(object):
Note: See TracChangeset for help on using the changeset viewer.