This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
pdferror = 'An error occured during PDF generation please contact administrator'
|
||||
|
||||
tokenexipired = 'Token expired'
|
||||
invalidtoken = 'Invalid token'
|
||||
notauthenticated = 'Not authenticated'
|
||||
failtogettoken = 'Failed to get token'
|
||||
unauthorized = 'Unauthorized'
|
||||
notallowed = 'Not Allowed'
|
||||
class Messages:
|
||||
unauthorized = 'User is Unauthorized'
|
||||
notauthenticated = 'User is not authenticated'
|
||||
tokenexipired = 'Token has expired'
|
||||
invalidtoken = 'Token is invalid'
|
||||
|
||||
@staticmethod
|
||||
def not_found(resource: str) -> str:
|
||||
return f'{resource.capitalize()} not found'
|
||||
|
||||
@staticmethod
|
||||
def invalid_input(resource: str, reason: str = "") -> str:
|
||||
return f'Invalid {resource} input {':' if reason else ""} {reason}'
|
||||
|
||||
notfound = 'Resource was not found.'
|
||||
usernotfound = 'User not found'
|
||||
userloggedout = 'User logged out'
|
||||
|
||||
productorinputinvalid = 'Invalid productor input'
|
||||
productornotfound = 'Productor not found'
|
||||
|
||||
forminputinvalid = 'Invalid form input'
|
||||
formnotfound = 'Form not found'
|
||||
|
||||
productinputinvalid = 'Invalid product input'
|
||||
productnotfound = 'Product not found'
|
||||
@staticmethod
|
||||
def not_allowed(resource: str, action: str) -> str:
|
||||
return f'User is not allowed to {action} this {resource}'
|
||||
Reference in New Issue
Block a user