mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 23:04:21 +00:00
Stefano Pigozzi
b44f7b4ebf
* ✨ Create Dockerfile for the backend * 🔧 Limit the allowed slug values * ✨ Create docker image for the proxy * ✨ Add serve script (and serve dependency) * ✨ Add .dockerignore symlinks to .gitignore * ✨ Create docker image for the frontend * 🔧 Proxy the frontend * 🔧 Configure the proxy.dbm directory * 🚧 WIP * 💥 Improve settings handling * 💥 Prepare backend for docker deployment * 🔧 Reserve `static` notebook slug * ✨ Make static work * 🐛 Set a default value for reduce * 💥 Things * 💥 Everything works!
16 lines
482 B
Python
16 lines
482 B
Python
from django.core.validators import ValidationError
|
|
from django.utils.deconstruct import deconstructible
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
@deconstructible
|
|
class DisallowedValuesValidator:
|
|
def __init__(self, values):
|
|
self.values = values
|
|
|
|
def __call__(self, value):
|
|
if value in self.values:
|
|
raise ValidationError(
|
|
_("%(value)s is a disallowed value."),
|
|
params={"value": value},
|
|
)
|