Translation of UI (german and english)
Bugfix for feeds
- removed categories related and up
- load new books now working
- category random now working
login page is free of non accessible elements
boolean custom column is vivible in UI
books with only with certain languages can be shown
book shelfs can be deleted from UI
Anonymous user view is more resticted
Added browse of series in sidebar
Dependencys in vendor folder are updated to newer versions (licencs files are now present)
Bugfix editing Authors names
Made upload on windows working
This commit is contained in:
Vendored
+80
-10
@@ -54,7 +54,7 @@
|
||||
return e
|
||||
|
||||
|
||||
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
|
||||
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import sys
|
||||
@@ -66,13 +66,14 @@ werkzeug.exceptions = sys.modules[__name__]
|
||||
|
||||
from werkzeug._internal import _get_environ
|
||||
from werkzeug._compat import iteritems, integer_types, text_type, \
|
||||
implements_to_string
|
||||
implements_to_string
|
||||
|
||||
from werkzeug.wrappers import Response
|
||||
|
||||
|
||||
@implements_to_string
|
||||
class HTTPException(Exception):
|
||||
|
||||
"""
|
||||
Baseclass for all HTTP exceptions. This exception can be called as WSGI
|
||||
application to render a default error page or you can catch the subclasses
|
||||
@@ -94,6 +95,7 @@ class HTTPException(Exception):
|
||||
also is a subclass of `BadRequest`.
|
||||
"""
|
||||
class newcls(cls, exception):
|
||||
|
||||
def __init__(self, arg=None, *args, **kwargs):
|
||||
cls.__init__(self, *args, **kwargs)
|
||||
exception.__init__(self, arg)
|
||||
@@ -161,6 +163,7 @@ class HTTPException(Exception):
|
||||
|
||||
|
||||
class BadRequest(HTTPException):
|
||||
|
||||
"""*400* `Bad Request`
|
||||
|
||||
Raise if the browser sends something to the application the application
|
||||
@@ -174,6 +177,7 @@ class BadRequest(HTTPException):
|
||||
|
||||
|
||||
class ClientDisconnected(BadRequest):
|
||||
|
||||
"""Internal exception that is raised if Werkzeug detects a disconnected
|
||||
client. Since the client is already gone at that point attempting to
|
||||
send the error message to the client might not work and might ultimately
|
||||
@@ -181,7 +185,7 @@ class ClientDisconnected(BadRequest):
|
||||
it is silenced by default as far as Werkzeug is concerned.
|
||||
|
||||
Since disconnections cannot be reliably detected and are unspecified
|
||||
by WSGI to a large extend this might or might not be raised if a client
|
||||
by WSGI to a large extent this might or might not be raised if a client
|
||||
is gone.
|
||||
|
||||
.. versionadded:: 0.8
|
||||
@@ -189,6 +193,7 @@ class ClientDisconnected(BadRequest):
|
||||
|
||||
|
||||
class SecurityError(BadRequest):
|
||||
|
||||
"""Raised if something triggers a security error. This is otherwise
|
||||
exactly like a bad request error.
|
||||
|
||||
@@ -196,7 +201,16 @@ class SecurityError(BadRequest):
|
||||
"""
|
||||
|
||||
|
||||
class BadHost(BadRequest):
|
||||
|
||||
"""Raised if the submitted host is badly formatted.
|
||||
|
||||
.. versionadded:: 0.11.2
|
||||
"""
|
||||
|
||||
|
||||
class Unauthorized(HTTPException):
|
||||
|
||||
"""*401* `Unauthorized`
|
||||
|
||||
Raise if the user is not authorized. Also used if you want to use HTTP
|
||||
@@ -212,6 +226,7 @@ class Unauthorized(HTTPException):
|
||||
|
||||
|
||||
class Forbidden(HTTPException):
|
||||
|
||||
"""*403* `Forbidden`
|
||||
|
||||
Raise if the user doesn't have the permission for the requested resource
|
||||
@@ -225,6 +240,7 @@ class Forbidden(HTTPException):
|
||||
|
||||
|
||||
class NotFound(HTTPException):
|
||||
|
||||
"""*404* `Not Found`
|
||||
|
||||
Raise if a resource does not exist and never existed.
|
||||
@@ -238,6 +254,7 @@ class NotFound(HTTPException):
|
||||
|
||||
|
||||
class MethodNotAllowed(HTTPException):
|
||||
|
||||
"""*405* `Method Not Allowed`
|
||||
|
||||
Raise if the server used a method the resource does not handle. For
|
||||
@@ -264,6 +281,7 @@ class MethodNotAllowed(HTTPException):
|
||||
|
||||
|
||||
class NotAcceptable(HTTPException):
|
||||
|
||||
"""*406* `Not Acceptable`
|
||||
|
||||
Raise if the server can't return any content conforming to the
|
||||
@@ -280,6 +298,7 @@ class NotAcceptable(HTTPException):
|
||||
|
||||
|
||||
class RequestTimeout(HTTPException):
|
||||
|
||||
"""*408* `Request Timeout`
|
||||
|
||||
Raise to signalize a timeout.
|
||||
@@ -292,6 +311,7 @@ class RequestTimeout(HTTPException):
|
||||
|
||||
|
||||
class Conflict(HTTPException):
|
||||
|
||||
"""*409* `Conflict`
|
||||
|
||||
Raise to signal that a request cannot be completed because it conflicts
|
||||
@@ -307,19 +327,21 @@ class Conflict(HTTPException):
|
||||
|
||||
|
||||
class Gone(HTTPException):
|
||||
|
||||
"""*410* `Gone`
|
||||
|
||||
Raise if a resource existed previously and went away without new location.
|
||||
"""
|
||||
code = 410
|
||||
description = (
|
||||
'The requested URL is no longer available on this server and '
|
||||
'there is no forwarding address.</p><p>If you followed a link '
|
||||
'from a foreign page, please contact the author of this page.'
|
||||
'The requested URL is no longer available on this server and there '
|
||||
'is no forwarding address. If you followed a link from a foreign '
|
||||
'page, please contact the author of this page.'
|
||||
)
|
||||
|
||||
|
||||
class LengthRequired(HTTPException):
|
||||
|
||||
"""*411* `Length Required`
|
||||
|
||||
Raise if the browser submitted data but no ``Content-Length`` header which
|
||||
@@ -333,6 +355,7 @@ class LengthRequired(HTTPException):
|
||||
|
||||
|
||||
class PreconditionFailed(HTTPException):
|
||||
|
||||
"""*412* `Precondition Failed`
|
||||
|
||||
Status code used in combination with ``If-Match``, ``If-None-Match``, or
|
||||
@@ -346,6 +369,7 @@ class PreconditionFailed(HTTPException):
|
||||
|
||||
|
||||
class RequestEntityTooLarge(HTTPException):
|
||||
|
||||
"""*413* `Request Entity Too Large`
|
||||
|
||||
The status code one should return if the data submitted exceeded a given
|
||||
@@ -358,6 +382,7 @@ class RequestEntityTooLarge(HTTPException):
|
||||
|
||||
|
||||
class RequestURITooLarge(HTTPException):
|
||||
|
||||
"""*414* `Request URI Too Large`
|
||||
|
||||
Like *413* but for too long URLs.
|
||||
@@ -370,6 +395,7 @@ class RequestURITooLarge(HTTPException):
|
||||
|
||||
|
||||
class UnsupportedMediaType(HTTPException):
|
||||
|
||||
"""*415* `Unsupported Media Type`
|
||||
|
||||
The status code returned if the server is unable to handle the media type
|
||||
@@ -383,6 +409,7 @@ class UnsupportedMediaType(HTTPException):
|
||||
|
||||
|
||||
class RequestedRangeNotSatisfiable(HTTPException):
|
||||
|
||||
"""*416* `Requested Range Not Satisfiable`
|
||||
|
||||
The client asked for a part of the file that lies beyond the end
|
||||
@@ -397,6 +424,7 @@ class RequestedRangeNotSatisfiable(HTTPException):
|
||||
|
||||
|
||||
class ExpectationFailed(HTTPException):
|
||||
|
||||
"""*417* `Expectation Failed`
|
||||
|
||||
The server cannot meet the requirements of the Expect request-header.
|
||||
@@ -410,6 +438,7 @@ class ExpectationFailed(HTTPException):
|
||||
|
||||
|
||||
class ImATeapot(HTTPException):
|
||||
|
||||
"""*418* `I'm a teapot`
|
||||
|
||||
The server should return this if it is a teapot and someone attempted
|
||||
@@ -424,6 +453,7 @@ class ImATeapot(HTTPException):
|
||||
|
||||
|
||||
class UnprocessableEntity(HTTPException):
|
||||
|
||||
"""*422* `Unprocessable Entity`
|
||||
|
||||
Used if the request is well formed, but the instructions are otherwise
|
||||
@@ -437,6 +467,7 @@ class UnprocessableEntity(HTTPException):
|
||||
|
||||
|
||||
class PreconditionRequired(HTTPException):
|
||||
|
||||
"""*428* `Precondition Required`
|
||||
|
||||
The server requires this request to be conditional, typically to prevent
|
||||
@@ -455,6 +486,7 @@ class PreconditionRequired(HTTPException):
|
||||
|
||||
|
||||
class TooManyRequests(HTTPException):
|
||||
|
||||
"""*429* `Too Many Requests`
|
||||
|
||||
The server is limiting the rate at which this user receives responses, and
|
||||
@@ -470,6 +502,7 @@ class TooManyRequests(HTTPException):
|
||||
|
||||
|
||||
class RequestHeaderFieldsTooLarge(HTTPException):
|
||||
|
||||
"""*431* `Request Header Fields Too Large`
|
||||
|
||||
The server refuses to process the request because the header fields are too
|
||||
@@ -483,6 +516,7 @@ class RequestHeaderFieldsTooLarge(HTTPException):
|
||||
|
||||
|
||||
class InternalServerError(HTTPException):
|
||||
|
||||
"""*500* `Internal Server Error`
|
||||
|
||||
Raise if an internal server error occurred. This is a good fallback if an
|
||||
@@ -497,6 +531,7 @@ class InternalServerError(HTTPException):
|
||||
|
||||
|
||||
class NotImplemented(HTTPException):
|
||||
|
||||
"""*501* `Not Implemented`
|
||||
|
||||
Raise if the application does not support the action requested by the
|
||||
@@ -510,6 +545,7 @@ class NotImplemented(HTTPException):
|
||||
|
||||
|
||||
class BadGateway(HTTPException):
|
||||
|
||||
"""*502* `Bad Gateway`
|
||||
|
||||
If you do proxying in your application you should return this status code
|
||||
@@ -524,6 +560,7 @@ class BadGateway(HTTPException):
|
||||
|
||||
|
||||
class ServiceUnavailable(HTTPException):
|
||||
|
||||
"""*503* `Service Unavailable`
|
||||
|
||||
Status code you should return if a service is temporarily unavailable.
|
||||
@@ -536,22 +573,55 @@ class ServiceUnavailable(HTTPException):
|
||||
)
|
||||
|
||||
|
||||
class GatewayTimeout(HTTPException):
|
||||
|
||||
"""*504* `Gateway Timeout`
|
||||
|
||||
Status code you should return if a connection to an upstream server
|
||||
times out.
|
||||
"""
|
||||
code = 504
|
||||
description = (
|
||||
'The connection to an upstream server timed out.'
|
||||
)
|
||||
|
||||
|
||||
class HTTPVersionNotSupported(HTTPException):
|
||||
|
||||
"""*505* `HTTP Version Not Supported`
|
||||
|
||||
The server does not support the HTTP protocol version used in the request.
|
||||
"""
|
||||
code = 505
|
||||
description = (
|
||||
'The server does not support the HTTP protocol version used in the '
|
||||
'request.'
|
||||
)
|
||||
|
||||
|
||||
default_exceptions = {}
|
||||
__all__ = ['HTTPException']
|
||||
|
||||
|
||||
def _find_exceptions():
|
||||
for name, obj in iteritems(globals()):
|
||||
try:
|
||||
if getattr(obj, 'code', None) is not None:
|
||||
default_exceptions[obj.code] = obj
|
||||
__all__.append(obj.__name__)
|
||||
except TypeError: # pragma: no cover
|
||||
is_http_exception = issubclass(obj, HTTPException)
|
||||
except TypeError:
|
||||
is_http_exception = False
|
||||
if not is_http_exception or obj.code is None:
|
||||
continue
|
||||
__all__.append(obj.__name__)
|
||||
old_obj = default_exceptions.get(obj.code, None)
|
||||
if old_obj is not None and issubclass(obj, old_obj):
|
||||
continue
|
||||
default_exceptions[obj.code] = obj
|
||||
_find_exceptions()
|
||||
del _find_exceptions
|
||||
|
||||
|
||||
class Aborter(object):
|
||||
|
||||
"""
|
||||
When passed a dict of code -> exception items it can be used as
|
||||
callable that raises exceptions. If the first argument to the
|
||||
|
||||
Reference in New Issue
Block a user