Merge branch 'Kerl/datetime_warnings' into supportBDS

This commit is contained in:
Qwann 2017-02-24 15:02:27 +01:00
commit e1713a1d4f
5 changed files with 18 additions and 10 deletions

View file

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import json
from datetime import datetime
from custommail.shortcuts import render_custom_mail
from django.shortcuts import render, get_object_or_404, redirect
@ -12,6 +11,7 @@ from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.utils import timezone
from .models import CofProfile
from .petits_cours_models import (
@ -279,7 +279,7 @@ def _traitement_post(request, demande):
unlock_tables()
demande.traitee = True
demande.traitee_par = request.user
demande.processed = datetime.now()
demande.processed = timezone.now()
demande.save()
return render(request,
"cof/traitement_demande_petit_cours_success.html",

View file

@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import django.core.validators
import datetime
from django.utils import timezone
class Migration(migrations.Migration):
@ -31,7 +31,7 @@ class Migration(migrations.Migration):
name='AccountNegative',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('start', models.DateTimeField(default=datetime.datetime(2016, 8, 2, 10, 22, 1, 569492))),
('start', models.DateTimeField(default=timezone.datetime(2016, 8, 2, 10, 22, 1, 569492, tzinfo=timezone.get_default_timezone()))),
('balance_offset', models.DecimalField(decimal_places=2, max_digits=6)),
('authorized_overdraft', models.DecimalField(decimal_places=2, default=0, max_digits=6)),
('comment', models.CharField(max_length=255, blank=True)),

View file

@ -2,7 +2,7 @@
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils import timezone
class Migration(migrations.Migration):
@ -19,6 +19,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='accountnegative',
name='start',
field=models.DateTimeField(default=datetime.datetime(2016, 8, 2, 21, 39, 30, 52279)),
field=models.DateTimeField(
default=timezone.datetime(
2016, 8, 2, 21, 39, 30, 52279,
tzinfo=timezone.get_default_timezone()
)
),
),
]

View file

@ -2,7 +2,7 @@
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils import timezone
class Migration(migrations.Migration):
@ -15,6 +15,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='accountnegative',
name='start',
field=models.DateTimeField(default=datetime.datetime.now),
field=models.DateTimeField(default=timezone.now),
),
]

View file

@ -2,7 +2,7 @@
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils import timezone
class Migration(migrations.Migration):
@ -15,6 +15,9 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='accountnegative',
name='start',
field=models.DateTimeField(default=datetime.datetime.now, blank=True, null=True),
field=models.DateTimeField(
default=timezone.now,
blank=True, null=True
),
),
]