Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use auto_now_add for date_joined_program field. Fix bug 743955. #132

Merged
merged 1 commit into from

2 participants

@glogiotatidis

No description provided.

@ednapiranha ednapiranha merged commit 85aeea8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
97 remo/profiles/migrations/0022_auto__chg_field_userprofile_date_joined_program.py
@@ -0,0 +1,97 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Changing field 'UserProfile.date_joined_program'
+ db.alter_column('profiles_userprofile', 'date_joined_program', self.gf('django.db.models.fields.DateField')(auto_now_add=True))
+
+
+ def backwards(self, orm):
+
+ # Changing field 'UserProfile.date_joined_program'
+ db.alter_column('profiles_userprofile', 'date_joined_program', self.gf('django.db.models.fields.DateField')())
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'profiles.functionalarea': {
+ 'Meta': {'object_name': 'FunctionalArea'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'profiles.userprofile': {
+ 'Meta': {'object_name': 'UserProfile'},
+ 'added_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'users_added'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'bio': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
+ 'birth_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'city': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50'}),
+ 'country': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50'}),
+ 'date_joined_program': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'diaspora_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
+ 'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'unique': 'True', 'max_length': '50', 'blank': 'True'}),
+ 'facebook_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
+ 'functional_areas': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['profiles.FunctionalArea']", 'null': 'True', 'blank': 'True'}),
+ 'gender': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'irc_channels': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
+ 'irc_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50'}),
+ 'jabber_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}),
+ 'lat': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
+ 'linkedin_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
+ 'local_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}),
+ 'lon': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
+ 'mentor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'mentees'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'mozillians_profile_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
+ 'personal_blog_feed': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
+ 'personal_website_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
+ 'private_email': ('django.db.models.fields.EmailField', [], {'default': "''", 'max_length': '75', 'null': 'True'}),
+ 'region': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50'}),
+ 'registration_complete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'twitter_account': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '16', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
+ 'wiki_profile_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'})
+ }
+ }
+
+ complete_apps = ['profiles']
View
3  remo/profiles/models.py
@@ -50,8 +50,7 @@ class UserProfile(models.Model):
"""Definition of UserProfile Model."""
user = models.OneToOneField(User)
registration_complete = models.BooleanField(default=False)
- date_joined_program = models.DateField(
- blank=True, default=datetime.date(month=6, year=2011, day=1))
+ date_joined_program = models.DateField(blank=True, auto_now_add=True)
local_name = models.CharField(max_length=100, blank=True, default='')
birth_date = models.DateField(validators=[_validate_birth_date],
blank=True, null=True)
Something went wrong with that request. Please try again.