12221.9.38
by Tim Penhey
Fix the field validation code for DuplicateBug to use the right error. |
1 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
|
2 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
|
3 |
||
4 |
"""Errors used in the lp/bugs modules."""
|
|
5 |
||
6 |
__metaclass__ = type |
|
7 |
__all__ = [ |
|
8 |
'InvalidBugTargetType', |
|
9 |
'InvalidDuplicateValue', |
|
10 |
]
|
|
11 |
||
12 |
from lazr.restful.declarations import webservice_error |
|
13 |
||
12442.2.2
by j.c.sackett
Moved validators to app, which makes more sense. |
14 |
from lp.app.validators import LaunchpadValidationError |
12221.9.39
by Tim Penhey
Hook up the moved bug errors. |
15 |
|
12221.9.38
by Tim Penhey
Fix the field validation code for DuplicateBug to use the right error. |
16 |
|
17 |
class InvalidBugTargetType(Exception): |
|
18 |
"""Bug target's type is not valid."""
|
|
19 |
webservice_error(400) |
|
20 |
||
21 |
||
12221.9.39
by Tim Penhey
Hook up the moved bug errors. |
22 |
class InvalidDuplicateValue(LaunchpadValidationError): |
12221.9.38
by Tim Penhey
Fix the field validation code for DuplicateBug to use the right error. |
23 |
"""A bug cannot be set as the duplicate of another."""
|
24 |
webservice_error(417) |