Fixes: 1) Add missing `constance.config` import in `views.py`; 2) Replace hardcoded timeframe logic with configurable period parsing; 3) Ensure proper handling of empty datasets for low stock and KPI calculations. Extra: Refactor dashboard templates to improve layout and add contextual adjustments (e.g., grid updates, daily sales title); Optimize cache handling for dashboard metrics; Cleanup unused legacy dashboard variables.
15 lines
431 B
Python
15 lines
431 B
Python
from django.contrib.auth.forms import ReadOnlyPasswordHashField, UserChangeForm
|
|
|
|
from engine.core.widgets import JSONTableWidget
|
|
from engine.vibes_auth.models import User
|
|
|
|
|
|
class UserForm(UserChangeForm): # type: ignore [type-arg]
|
|
password = ReadOnlyPasswordHashField(label="Password")
|
|
|
|
class Meta:
|
|
model = User
|
|
fields = "__all__"
|
|
widgets = {
|
|
"attributes": JSONTableWidget(),
|
|
}
|