1. Luke Plant
  2. django-anonymizer

Commits

Luke Plant  committed 7a60b12

Simplified signatures of datetime and date fake sources

  • Participants
  • Parent commits 40b8534
  • Branches default

Comments (0)

Files changed (1)

File anonymizer/base.py

View file
  • Ignore whitespace
         source = lambda: bool(randrange(0, 2))
         return self._get_allowed_value(source, field)
 
-    def datetime(self, obj=None, field=None, val=None):
+    def datetime(self, field=None, val=None):
         """
         Returns a random datetime. If 'val' is passed, a datetime within two
         years of that date will be returned.
                                                     randrange(-365*24*3600*2, 365*24*3600*2))
         return self._get_allowed_value(source, field)
 
-    def date(self, obj=None, field=None, val=None):
+    def date(self, field=None, val=None):
         """
         Like datetime, but truncated to be a date only
         """
-        d = self.datetime(obj=obj, field=field, val=val)
+        d = self.datetime(field=field, val=val)
         return d.date()
 
     def uk_postcode(self, field=None):