forked from unioslo/mreg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass, updated releavant dependencies.
- Signals or something is broken, zone generation fails. - Probably other issues as well.
- Loading branch information
Showing
15 changed files
with
362 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from rest_framework import (exceptions, status) | ||
|
||
from typing import Any | ||
|
||
class CustomAPIExceptionError(exceptions.APIException): | ||
def __init__(self, detail: Any = None): | ||
detail = {"ERROR": detail if detail is not None else self.default_detail} | ||
super().__init__(detail) | ||
|
||
|
||
class ValidationError400(CustomAPIExceptionError): | ||
status_code = 400 | ||
default_detail:str = 'Bad Request' | ||
|
||
class ValidationError403(CustomAPIExceptionError): | ||
status_code = status.HTTP_403_FORBIDDEN | ||
default_detail:str = 'Forbidden' | ||
|
||
class ValidationError404(CustomAPIExceptionError): | ||
status_code = status.HTTP_404_NOT_FOUND | ||
default_detail:str = 'Not Found' | ||
|
||
class ValidationError409(CustomAPIExceptionError): | ||
status_code = status.HTTP_409_CONFLICT | ||
default_detail:str = 'Conflict' | ||
|
||
class InternalServerError500(CustomAPIExceptionError): | ||
status_code = status.HTTP_500_INTERNAL_SERVER_ERROR | ||
default_detail:str = 'Internal Server Error' | ||
|
||
class NoIpAddressesError404(ValidationError404): | ||
default_detail:str = 'No free ip addresses found in the network.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.