Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chinskiy committed Apr 18, 2024
1 parent 1eb9b50 commit 909b9fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions example/anonymizer/base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from __future__ import absolute_import

import datetime

from django.contrib.admin.models import LogEntry
from django.contrib.auth.models import Group, Permission, User
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session
from django.utils import timezone

from dj_anonymizer import fields
from dj_anonymizer.register_models import (
Expand All @@ -18,9 +17,9 @@

class UserAnonym(AnonymBase):
email = fields.string('test_email_{seq}@preply.com',
seq_callback=datetime.datetime.now)
seq_callback=timezone.now)
username = fields.string('test_username_{seq}@preply.com',
seq_callback=datetime.datetime.now)
seq_callback=timezone.now)
first_name = fields.string('first name {seq}')
last_name = fields.string('last name {seq}')
password = fields.password('password')
Expand Down
4 changes: 2 additions & 2 deletions example/anonymizer/polls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import absolute_import

import datetime
from django.utils import timezone

from dj_anonymizer import fields
from dj_anonymizer.register_models import (
Expand All @@ -13,7 +13,7 @@

class QuestionAnonym(AnonymBase):
question_text = fields.string("John Doe {seq}")
pub_date = fields.function(datetime.datetime.now)
pub_date = fields.function(timezone.now)

class Meta:
pass
Expand Down
4 changes: 2 additions & 2 deletions example/project/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf.urls import url
from django.contrib import admin
from django.urls import path


urlpatterns = [
url(r'^admin/', admin.site.urls),
path('admin/', admin.site.urls),
]

0 comments on commit 909b9fa

Please sign in to comment.