fix pre-commit
Some checks failed
CI/CD Pipeline / Code Quality Checks (pull_request) Successful in 3m6s
CI/CD Pipeline / Run API Inventory E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been cancelled
CI/CD Pipeline / Run Tests (pull_request) Has been cancelled
Some checks failed
CI/CD Pipeline / Code Quality Checks (pull_request) Successful in 3m6s
CI/CD Pipeline / Run API Inventory E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been cancelled
CI/CD Pipeline / Run Tests (pull_request) Has been cancelled
This commit is contained in:
@@ -164,7 +164,9 @@ class ExchangePeriodicTaskSerializer(serializers.ModelSerializer):
|
||||
return int(value) if str(value).isdigit() else None
|
||||
|
||||
def get_crontab_minute(self, obj: PeriodicTask) -> int | None:
|
||||
return self._coerce_crontab_number(obj.crontab.minute) if obj.crontab_id else None
|
||||
return (
|
||||
self._coerce_crontab_number(obj.crontab.minute) if obj.crontab_id else None
|
||||
)
|
||||
|
||||
def get_crontab_hour(self, obj: PeriodicTask) -> int | None:
|
||||
return self._coerce_crontab_number(obj.crontab.hour) if obj.crontab_id else None
|
||||
@@ -216,11 +218,7 @@ class ExchangePeriodicTaskUpsertSerializer(serializers.Serializer):
|
||||
schedule_type = str(attrs["schedule_type"]).strip().lower()
|
||||
if schedule_type not in {"interval", "daily"}:
|
||||
raise serializers.ValidationError(
|
||||
{
|
||||
"schedule_type": (
|
||||
"Допустимые значения: interval или daily."
|
||||
)
|
||||
}
|
||||
{"schedule_type": ("Допустимые значения: interval или daily.")}
|
||||
)
|
||||
return schedule_type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user