Skip to content

Min value should be Decimal#15413

Merged
AlanCoding merged 1 commit intodevelfrom
min-value-decimal
Dec 17, 2024
Merged

Min value should be Decimal#15413
AlanCoding merged 1 commit intodevelfrom
min-value-decimal

Conversation

@kdelee
Copy link
Member

@kdelee kdelee commented Jul 31, 2024

This hopefully resolves error message seen in logs sometimes about "should be Decimal type"

ISSUE TYPE

  • Bug, Docs Fix or other nominal change

COMPONENT NAME

  • API

@sonarqubecloud
Copy link

editable=False,
)
capacity_adjustment = models.DecimalField(default=Decimal(1.0), max_digits=3, decimal_places=2, validators=[MinValueValidator(0)])
capacity_adjustment = models.DecimalField(default=Decimal(1.0), max_digits=3, decimal_places=2, validators=[MinValueValidator(Decimal(0.0))])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not require a new migration file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash-5.1$ awx-manage makemigrations
No changes detected

Does not appear so

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think it actually changes the datatype, but rather validator function in Django

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validators had some weird place in both the fields and the model Meta. Weird but possible.

@AlanCoding
Copy link
Member

A test could be nice too.

@kdelee kdelee force-pushed the min-value-decimal branch 2 times, most recently from 20a1df2 to 9ee487d Compare September 24, 2024 16:46
@sonarqubecloud
Copy link

This hopefully resolves error message seen in logs sometimes about "should be Decimal type"
@sonarqubecloud
Copy link

@AlanCoding AlanCoding merged commit 29f3679 into devel Dec 17, 2024
@AlanCoding AlanCoding deleted the min-value-decimal branch December 17, 2024 17:45
@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.34%. Comparing base (36c75a2) to head (2e9a9aa).
Report is 88 commits behind head on devel.

✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants