Commits

Cole Krumbholz  committed f827796

fixing default blank date bug

  • Participants
  • Parent commits fa7aa06

Comments (0)

Files changed (2)

File registration/migrations/0002_add_field_registrationprofile_date_created.py

     def forwards(self, orm):
         
         # Adding field 'RegistrationProfile.date_created'
-        db.add_column('registration_registrationprofile', 'date_created', self.gf('django.db.models.fields.DateTimeField')(default='', auto_now_add=True, blank=True), keep_default=False)
-        
+        db.add_column('registration_registrationprofile', 'date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True), keep_default=False)
+
         for profile in orm.RegistrationProfile.objects.all():
             profile.date_created = profile.user.date_joined
             profile.save()
         'registration.registrationprofile': {
             'Meta': {'object_name': 'RegistrationProfile'},
             'activation_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'default': "''", 'auto_now_add': 'True', 'blank': 'True'}),
+            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'registration_profile'", 'unique': 'True', 'to': "orm['auth.User']"})
         }

File registration/models.py

     
     user = models.OneToOneField(User, verbose_name=_('user'), related_name='registration_profile')
     activation_key = models.CharField(_('activation key'), max_length=40)
-    date_created = models.DateTimeField(auto_now_add=True, blank=True, default='')
+    date_created = models.DateTimeField(auto_now_add=True, blank=True, null=True)
     
     objects = RegistrationManager()