Files
amap/backend/src/messages.py
Julien Aldon d28640711c
Some checks failed
Deploy Amap / deploy (push) Failing after 52s
add forms, shipments tests
2026-02-27 12:21:50 +01:00

19 lines
709 B
Python

pdferror = 'An error occured during PDF generation please contact administrator'
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}'
@staticmethod
def not_allowed(resource: str, action: str) -> str:
return f'User is not allowed to {action} this {resource}'