Skip to content

Commit

Permalink
Removing identi.ca field and adding github field to user - closes #145
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanP committed Dec 19, 2013
1 parent 3edac26 commit 782e356
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Meta:
model = User
fields = ('first_name', 'last_name',
'institution', 'role', 'twitter', 'facebook',
'google_talk', 'identi_ca', 'webpage', 'bio')
'google_talk', 'github', 'webpage', 'bio')

twitter = SocialAccountField(url='https://twitter.com/', required=False)
facebook = SocialAccountField(url='https://graph.facebook.com/', required=False)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# -*- coding: 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):
# Deleting field 'User.identi_ca'
db.delete_column(u'accounts_user', 'identi_ca')

# Adding field 'User.github'
db.add_column(u'accounts_user', 'github',
self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True),
keep_default=False)


def backwards(self, orm):
# Adding field 'User.identi_ca'
db.add_column(u'accounts_user', 'identi_ca',
self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True),
keep_default=False)

# Deleting field 'User.github'
db.delete_column(u'accounts_user', 'github')


models = {
u'accounts.user': {
'Meta': {'object_name': 'User'},
'bio': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}),
'facebook': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'github': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
'google_talk': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institution': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': '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'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'role': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
'twitter': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
'verification_hash': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
'webpage': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'})
},
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'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'}),
u'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'})
}
}

complete_apps = ['accounts']
4 changes: 2 additions & 2 deletions src/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class User(AbstractUser):
twitter = models.CharField(max_length=128, null=True, blank=True)
facebook = models.CharField(max_length=128, null=True, blank=True)
google_talk = models.EmailField(null=True, blank=True)
identi_ca = models.CharField(max_length=128, null=True, blank=True,
verbose_name=u'identi.ca')
github = models.CharField(max_length=128, null=True, blank=True,
verbose_name=u'github')
webpage = models.CharField(max_length=256, null=True, blank=True)
verification_hash = models.CharField(max_length=32, null=True, blank=True)
modified = models.DateTimeField(auto_now=True)
Expand Down
4 changes: 2 additions & 2 deletions src/accounts/templates/accounts/user_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ <h1>
<li><span class="icon-google-plus icon-fixed-width" title="{% trans 'Google talk account' %}"></span> {{ user_.google_talk }}</li>
{% endif %}

{% if user_.identi_ca %}
<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>
{% if user_.github %}
<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>
{% endif %}

{% if user_.webpage %}
Expand Down

0 comments on commit 782e356

Please sign in to comment.