Skip to content

Commit

Permalink
Merge pull request #12 from igorkramaric/django-5
Browse files Browse the repository at this point in the history
tz aware datetime
  • Loading branch information
igorkramaric authored May 20, 2024
2 parents 9a19767 + f1d67f5 commit e940d10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions badges/migrations/0002_auto_20150513_0429.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-


from django.db import models, migrations
import datetime
from django.conf import settings
from django.utils import timezone


class Migration(migrations.Migration):
Expand All @@ -26,7 +25,7 @@ class Migration(migrations.Migration):
name='BadgeToUser',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(default=datetime.datetime.now)),
('created', models.DateTimeField(default=timezone.now)),
('badge', models.ForeignKey(to='badges.Badge', on_delete=models.CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
Expand Down
7 changes: 3 additions & 4 deletions badges/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

from datetime import datetime

from django.utils import timezone
from django.contrib.auth import get_user_model

try:
from django.urls import reverse
except ImportError:
Expand Down Expand Up @@ -83,7 +82,7 @@ class BadgeToUser(models.Model):
badge = models.ForeignKey(Badge, on_delete=models.CASCADE)
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)

created = models.DateTimeField(default=datetime.now)
created = models.DateTimeField(default=timezone.now)


from . import listeners

0 comments on commit e940d10

Please sign in to comment.