Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tz aware datetime #12

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading