Commit 782e3569f0e88a6e8c49b579869f3e6b8b7a6298

Authored by Luan
1 parent 3edac263

Removing identi.ca field and adding github field to user - closes #145

src/accounts/forms.py
@@ -62,7 +62,7 @@ class UserUpdateForm(UserForm): @@ -62,7 +62,7 @@ class UserUpdateForm(UserForm):
62 model = User 62 model = User
63 fields = ('first_name', 'last_name', 63 fields = ('first_name', 'last_name',
64 'institution', 'role', 'twitter', 'facebook', 64 'institution', 'role', 'twitter', 'facebook',
65 - 'google_talk', 'identi_ca', 'webpage', 'bio') 65 + 'google_talk', 'github', 'webpage', 'bio')
66 66
67 twitter = SocialAccountField(url='https://twitter.com/', required=False) 67 twitter = SocialAccountField(url='https://twitter.com/', required=False)
68 facebook = SocialAccountField(url='https://graph.facebook.com/', required=False) 68 facebook = SocialAccountField(url='https://graph.facebook.com/', required=False)
src/accounts/migrations/0010_auto__del_field_user_identi_ca__add_field_user_github.py 0 → 100644
@@ -0,0 +1,79 @@ @@ -0,0 +1,79 @@
  1 +# -*- coding: utf-8 -*-
  2 +import datetime
  3 +from south.db import db
  4 +from south.v2 import SchemaMigration
  5 +from django.db import models
  6 +
  7 +
  8 +class Migration(SchemaMigration):
  9 +
  10 + def forwards(self, orm):
  11 + # Deleting field 'User.identi_ca'
  12 + db.delete_column(u'accounts_user', 'identi_ca')
  13 +
  14 + # Adding field 'User.github'
  15 + db.add_column(u'accounts_user', 'github',
  16 + self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True),
  17 + keep_default=False)
  18 +
  19 +
  20 + def backwards(self, orm):
  21 + # Adding field 'User.identi_ca'
  22 + db.add_column(u'accounts_user', 'identi_ca',
  23 + self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True),
  24 + keep_default=False)
  25 +
  26 + # Deleting field 'User.github'
  27 + db.delete_column(u'accounts_user', 'github')
  28 +
  29 +
  30 + models = {
  31 + u'accounts.user': {
  32 + 'Meta': {'object_name': 'User'},
  33 + 'bio': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
  34 + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  35 + 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}),
  36 + 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  37 + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  38 + 'github': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  39 + 'google_talk': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
  40 + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
  41 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  42 + 'institution': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  43 + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  44 + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  45 + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  46 + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  47 + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  48 + 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  49 + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  50 + 'role': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  51 + 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  52 + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
  53 + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
  54 + 'verification_hash': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
  55 + 'webpage': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'})
  56 + },
  57 + u'auth.group': {
  58 + 'Meta': {'object_name': 'Group'},
  59 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  60 + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
  61 + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
  62 + },
  63 + u'auth.permission': {
  64 + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
  65 + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  66 + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
  67 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  68 + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  69 + },
  70 + u'contenttypes.contenttype': {
  71 + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
  72 + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  73 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  74 + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  75 + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
  76 + }
  77 + }
  78 +
  79 + complete_apps = ['accounts']
0 \ No newline at end of file 80 \ No newline at end of file
src/accounts/models.py
@@ -20,8 +20,8 @@ class User(AbstractUser): @@ -20,8 +20,8 @@ class User(AbstractUser):
20 twitter = models.CharField(max_length=128, null=True, blank=True) 20 twitter = models.CharField(max_length=128, null=True, blank=True)
21 facebook = models.CharField(max_length=128, null=True, blank=True) 21 facebook = models.CharField(max_length=128, null=True, blank=True)
22 google_talk = models.EmailField(null=True, blank=True) 22 google_talk = models.EmailField(null=True, blank=True)
23 - identi_ca = models.CharField(max_length=128, null=True, blank=True,  
24 - verbose_name=u'identi.ca') 23 + github = models.CharField(max_length=128, null=True, blank=True,
  24 + verbose_name=u'github')
25 webpage = models.CharField(max_length=256, null=True, blank=True) 25 webpage = models.CharField(max_length=256, null=True, blank=True)
26 verification_hash = models.CharField(max_length=32, null=True, blank=True) 26 verification_hash = models.CharField(max_length=32, null=True, blank=True)
27 modified = models.DateTimeField(auto_now=True) 27 modified = models.DateTimeField(auto_now=True)
src/accounts/templates/accounts/user_detail.html
@@ -69,8 +69,8 @@ @@ -69,8 +69,8 @@
69 <li><span class="icon-google-plus icon-fixed-width" title="{% trans 'Google talk account' %}"></span> {{ user_.google_talk }}</li> 69 <li><span class="icon-google-plus icon-fixed-width" title="{% trans 'Google talk account' %}"></span> {{ user_.google_talk }}</li>
70 {% endif %} 70 {% endif %}
71 71
72 - {% if user_.identi_ca %}  
73 - <li><span class="icon-comments icon-fixed-width" title="{% trans 'Identi.ca account' %}"></span> <a target="_blank" href="https://identi.ca/{{ user_.identi_ca }}">{{ user_.identi_ca }}</a></li> 72 + {% if user_.github %}
  73 + <li><span class="icon-github icon-fixed-width" title="{% trans 'Github account' %}"></span> <a target="_blank" href="https://github.com/{{ user_.github }}">{{ user_.github }}</a></li>
74 {% endif %} 74 {% endif %}
75 75
76 {% if user_.webpage %} 76 {% if user_.webpage %}