~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/interfaces/bugtask.py

[r=danilo][bug=878260] macro
        bugtarget-macros-search/simple-search-form: Show a title;
        drop the 'order by' widget; CSS changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
    'BugTaskStatus',
18
18
    'BugTaskStatusSearch',
19
19
    'BugTaskStatusSearchDisplay',
20
 
    'CannotDeleteBugtask',
21
20
    'DB_INCOMPLETE_BUGTASK_STATUSES',
22
21
    'DB_UNRESOLVED_BUGTASK_STATUSES',
23
22
    'DEFAULT_SEARCH_BUGTASK_STATUSES_FOR_DISPLAY',
25
24
    'IAddBugTaskForm',
26
25
    'IAddBugTaskWithProductCreationForm',
27
26
    'IBugTask',
28
 
    'IBugTaskDelete',
29
27
    'IBugTaskDelta',
30
28
    'IBugTaskSearch',
31
29
    'IBugTaskSet',
60
58
    call_with,
61
59
    error_status,
62
60
    export_as_webservice_entry,
63
 
    export_destructor_operation,
64
61
    export_read_operation,
65
62
    export_write_operation,
66
63
    exported,
438
435
    for item in DEFAULT_SEARCH_BUGTASK_STATUSES]
439
436
 
440
437
 
441
 
@error_status(httplib.BAD_REQUEST)
442
 
class CannotDeleteBugtask(Exception):
443
 
    """The bugtask cannot be deleted.
444
 
 
445
 
    Raised when a user tries to delete a bugtask but the deletion cannot
446
 
    proceed because of a model constraint or other business rule violation.
447
 
    """
448
 
 
449
 
 
450
438
@error_status(httplib.UNAUTHORIZED)
451
439
class UserCannotEditBugTaskStatus(Unauthorized):
452
440
    """User not permitted to change status.
494
482
    in a search for related bug tasks"""
495
483
 
496
484
 
497
 
class IBugTaskDelete(Interface):
498
 
    """An interface for operations allowed with the Delete permission."""
499
 
    @export_destructor_operation()
500
 
    @call_with(who=REQUEST_USER)
501
 
    @operation_for_version('devel')
502
 
    def delete(who):
503
 
        """Delete this bugtask.
504
 
 
505
 
        :param who: the user who is removing the bugtask.
506
 
        :raises: CannotDeleteBugtask if the bugtask cannot be deleted due to a
507
 
            business rule or other model constraint.
508
 
        :raises: Unauthorized if the user does not have permission
509
 
            to delete the bugtask.
510
 
        """
511
 
 
512
 
 
513
 
class IBugTask(IHasDateCreated, IHasBug, IBugTaskDelete):
 
485
class IBugTask(IHasDateCreated, IHasBug):
514
486
    """A bug needing fixing in a particular product or package."""
515
487
    export_as_webservice_entry()
516
488