fastadmin 0.2.15__py3-none-any.whl → 0.2.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fastadmin/api/service.py CHANGED
@@ -460,6 +460,7 @@ class ApiService:
460
460
  username_field=settings.ADMIN_USER_MODEL_USERNAME_FIELD,
461
461
  date_format=settings.ADMIN_DATE_FORMAT,
462
462
  datetime_format=settings.ADMIN_DATETIME_FORMAT,
463
+ disable_crop_image=settings.ADMIN_DISABLE_CROP_IMAGE,
463
464
  models=[],
464
465
  dashboard_widgets=[],
465
466
  )
@@ -476,6 +477,7 @@ class ApiService:
476
477
  username_field=settings.ADMIN_USER_MODEL_USERNAME_FIELD,
477
478
  date_format=settings.ADMIN_DATE_FORMAT,
478
479
  datetime_format=settings.ADMIN_DATETIME_FORMAT,
480
+ disable_crop_image=settings.ADMIN_DISABLE_CROP_IMAGE,
479
481
  models=models,
480
482
  dashboard_widgets=dashboard_widgets,
481
483
  ) # type: ignore [call-arg]
@@ -172,6 +172,7 @@ class ConfigurationSchema:
172
172
  username_field: str
173
173
  date_format: str
174
174
  datetime_format: str
175
+ disable_crop_image: bool
175
176
  models: Sequence[ModelSchema]
176
177
  dashboard_widgets: Sequence[DashboardWidgetSchema]
177
178
 
fastadmin/settings.py CHANGED
@@ -50,5 +50,8 @@ class Settings:
50
50
  # or attackers could use it to generate their own signed values.
51
51
  ADMIN_SECRET_KEY: str = os.getenv("ADMIN_SECRET_KEY")
52
52
 
53
+ # This value disables the crop image feature in FastAdmin.
54
+ ADMIN_DISABLE_CROP_IMAGE: bool = os.getenv("ADMIN_DISABLE_CROP_IMAGE", False)
55
+
53
56
 
54
57
  settings = Settings()