diff --git a/barker/barker/routers/regime.py b/barker/barker/routers/regime.py index 3a54fce..e0ed6bb 100644 --- a/barker/barker/routers/regime.py +++ b/barker/barker/routers/regime.py @@ -24,7 +24,7 @@ def save( try: with SessionFuture() as db: regime_id = db.execute(select(func.coalesce(func.max(Regime.id), 0) + 1)).scalar_one() - item = Regime(id=regime_id, name=data.name, header=data.header, prefix=data.prefix) + item = Regime(id=regime_id, name=data.name.strip(), header=data.header, prefix=data.prefix.strip()) db.add(item) db.commit() return regime_info(item) @@ -49,9 +49,9 @@ def update_route( status_code=status.HTTP_423_LOCKED, detail=f"{item.name} is a fixture and cannot be edited or deleted.", ) - item.name = data.name + item.name = data.name.strip() item.header = data.header - item.prefix = data.prefix + item.prefix = data.prefix.strip() db.commit() return regime_info(item) except SQLAlchemyError as e: diff --git a/barker/barker/schemas/regime.py b/barker/barker/schemas/regime.py index 851b8d1..1670a39 100644 --- a/barker/barker/schemas/regime.py +++ b/barker/barker/schemas/regime.py @@ -10,7 +10,6 @@ class RegimeIn(BaseModel): is_fixture: bool class Config: - anystr_strip_whitespace = True alias_generator = to_camel @@ -18,7 +17,6 @@ class Regime(RegimeIn): id_: int class Config: - anystr_strip_whitespace = True alias_generator = to_camel @@ -28,7 +26,6 @@ class RegimeBlank(RegimeIn): prefix: str class Config: - anystr_strip_whitespace = True alias_generator = to_camel diff --git a/bookie/src/app/regimes/regime-detail/regime-detail.component.html b/bookie/src/app/regimes/regime-detail/regime-detail.component.html index 3a35d30..c2c26b5 100644 --- a/bookie/src/app/regimes/regime-detail/regime-detail.component.html +++ b/bookie/src/app/regimes/regime-detail/regime-detail.component.html @@ -13,7 +13,7 @@