mirror of
https://github.com/wger-project/wger.git
synced 2026-12-05 23:44:05 +01:00
Change measurement entry default to be timezone-aware
This commit is contained in:
18
wger/measurements/migrations/0007_alter_measurement_date.py
Normal file
18
wger/measurements/migrations/0007_alter_measurement_date.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
"""This only changes de default"""
|
||||
|
||||
dependencies = [
|
||||
('measurements', '0006_change_measurement_pk_to_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='measurement',
|
||||
name='date',
|
||||
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date'),
|
||||
),
|
||||
]
|
||||
@@ -12,11 +12,6 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Standard Library
|
||||
|
||||
# Standard Library
|
||||
import datetime
|
||||
import uuid
|
||||
|
||||
# Django
|
||||
from django.core.validators import (
|
||||
@@ -24,6 +19,7 @@ from django.core.validators import (
|
||||
MinValueValidator,
|
||||
)
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
# wger
|
||||
from wger.measurements.models import Category
|
||||
@@ -52,7 +48,7 @@ class Measurement(models.Model):
|
||||
|
||||
date = models.DateTimeField(
|
||||
verbose_name='Date',
|
||||
default=datetime.datetime.now,
|
||||
default=timezone.now,
|
||||
)
|
||||
|
||||
value = models.DecimalField(
|
||||
|
||||
Reference in New Issue
Block a user