Commit 3d3549222a967ca81d14844646dbc1b5bcd5453f
Exists in
master
and in
39 other branches
Merge branch 'master' into haystack
Showing
4 changed files
with
160 additions
and
6 deletions
Show diff stats
Vagrantfile
@@ -47,13 +47,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | @@ -47,13 +47,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
47 | # backing providers for Vagrant. These expose provider-specific options. | 47 | # backing providers for Vagrant. These expose provider-specific options. |
48 | # Example for VirtualBox: | 48 | # Example for VirtualBox: |
49 | # | 49 | # |
50 | - # config.vm.provider :virtualbox do |vb| | 50 | + config.vm.provider :virtualbox do |vb| |
51 | # # Don't boot with headless mode | 51 | # # Don't boot with headless mode |
52 | # vb.gui = true | 52 | # vb.gui = true |
53 | - # | ||
54 | - # # Use VBoxManage to customize the VM. For example to change memory: | ||
55 | - # vb.customize ["modifyvm", :id, "--memory", "1024"] | ||
56 | - # end | 53 | + |
54 | + # Use VBoxManage to customize the VM. For example to change memory: | ||
55 | + vb.customize ["modifyvm", :id, "--memory", "1024"] | ||
56 | + end | ||
57 | # | 57 | # |
58 | # View the documentation for the provider you're using for more | 58 | # View the documentation for the provider you're using for more |
59 | # information on available options. | 59 | # information on available options. |
src/accounts/templates/accounts/user_create_form.html
src/super_archives/migrations/0013_auto__add_emailaddressvalidation.py
0 → 100644
@@ -0,0 +1,145 @@ | @@ -0,0 +1,145 @@ | ||
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 | + # Adding model 'EmailAddressValidation' | ||
12 | + db.create_table(u'super_archives_emailaddressvalidation', ( | ||
13 | + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
14 | + ('address', self.gf('django.db.models.fields.EmailField')(unique=True, max_length=75)), | ||
15 | + ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='emails_not_validated', null=True, to=orm['accounts.User'])), | ||
16 | + ('validation_key', self.gf('django.db.models.fields.CharField')(default='2a261e5a2f944d36b252629b1a108e7b', max_length=32)), | ||
17 | + ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), | ||
18 | + )) | ||
19 | + db.send_create_signal(u'super_archives', ['EmailAddressValidation']) | ||
20 | + | ||
21 | + | ||
22 | + def backwards(self, orm): | ||
23 | + # Deleting model 'EmailAddressValidation' | ||
24 | + db.delete_table(u'super_archives_emailaddressvalidation') | ||
25 | + | ||
26 | + | ||
27 | + models = { | ||
28 | + u'accounts.user': { | ||
29 | + 'Meta': {'object_name': 'User'}, | ||
30 | + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
31 | + 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}), | ||
32 | + 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), | ||
33 | + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
34 | + 'google_talk': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}), | ||
35 | + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), | ||
36 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
37 | + 'institution': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), | ||
38 | + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
39 | + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
40 | + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
41 | + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
42 | + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
43 | + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
44 | + 'role': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), | ||
45 | + 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), | ||
46 | + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), | ||
47 | + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), | ||
48 | + 'verification_hash': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}), | ||
49 | + 'webpage': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}) | ||
50 | + }, | ||
51 | + u'auth.group': { | ||
52 | + 'Meta': {'object_name': 'Group'}, | ||
53 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
54 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), | ||
55 | + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) | ||
56 | + }, | ||
57 | + u'auth.permission': { | ||
58 | + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, | ||
59 | + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
60 | + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), | ||
61 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
62 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
63 | + }, | ||
64 | + u'contenttypes.contenttype': { | ||
65 | + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, | ||
66 | + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
67 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
68 | + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
69 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
70 | + }, | ||
71 | + u'super_archives.emailaddress': { | ||
72 | + 'Meta': {'object_name': 'EmailAddress'}, | ||
73 | + 'address': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75'}), | ||
74 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
75 | + 'md5': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), | ||
76 | + 'real_name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'blank': 'True'}), | ||
77 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emails'", 'null': 'True', 'to': u"orm['accounts.User']"}) | ||
78 | + }, | ||
79 | + u'super_archives.emailaddressvalidation': { | ||
80 | + 'Meta': {'object_name': 'EmailAddressValidation'}, | ||
81 | + 'address': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75'}), | ||
82 | + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
83 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
84 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emails_not_validated'", 'null': 'True', 'to': u"orm['accounts.User']"}), | ||
85 | + 'validation_key': ('django.db.models.fields.CharField', [], {'default': "'0dd1ae4b49bc43ff904c1cfa3b2e6ef6'", 'max_length': '32'}) | ||
86 | + }, | ||
87 | + u'super_archives.mailinglist': { | ||
88 | + 'Meta': {'object_name': 'MailingList'}, | ||
89 | + 'description': ('django.db.models.fields.TextField', [], {}), | ||
90 | + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), | ||
91 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
92 | + 'last_imported_index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
93 | + 'logo': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), | ||
94 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}) | ||
95 | + }, | ||
96 | + u'super_archives.mailinglistmembership': { | ||
97 | + 'Meta': {'object_name': 'MailingListMembership'}, | ||
98 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
99 | + 'mailinglist': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['super_archives.MailingList']"}), | ||
100 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.User']"}) | ||
101 | + }, | ||
102 | + u'super_archives.message': { | ||
103 | + 'Meta': {'unique_together': "(('thread', 'message_id'),)", 'object_name': 'Message'}, | ||
104 | + 'body': ('django.db.models.fields.TextField', [], {'default': "''"}), | ||
105 | + 'from_address': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['super_archives.EmailAddress']"}), | ||
106 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
107 | + 'message_id': ('django.db.models.fields.CharField', [], {'max_length': '512'}), | ||
108 | + 'received_time': ('django.db.models.fields.DateTimeField', [], {}), | ||
109 | + 'spam': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
110 | + 'subject': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), | ||
111 | + 'subject_clean': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), | ||
112 | + 'thread': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['super_archives.Thread']", 'null': 'True'}) | ||
113 | + }, | ||
114 | + u'super_archives.messagemetadata': { | ||
115 | + 'Message': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['super_archives.Message']"}), | ||
116 | + 'Meta': {'object_name': 'MessageMetadata'}, | ||
117 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
118 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), | ||
119 | + 'value': ('django.db.models.fields.TextField', [], {}) | ||
120 | + }, | ||
121 | + u'super_archives.pagehit': { | ||
122 | + 'Meta': {'object_name': 'PageHit'}, | ||
123 | + 'hit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
124 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
125 | + 'url_path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '2048', 'db_index': 'True'}) | ||
126 | + }, | ||
127 | + u'super_archives.thread': { | ||
128 | + 'Meta': {'unique_together': "(('subject_token', 'mailinglist'),)", 'object_name': 'Thread'}, | ||
129 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
130 | + 'latest_message': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'+'", 'unique': 'True', 'null': 'True', 'to': u"orm['super_archives.Message']"}), | ||
131 | + 'mailinglist': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['super_archives.MailingList']"}), | ||
132 | + 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
133 | + 'spam': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
134 | + 'subject_token': ('django.db.models.fields.CharField', [], {'max_length': '512'}) | ||
135 | + }, | ||
136 | + u'super_archives.vote': { | ||
137 | + 'Meta': {'unique_together': "(('user', 'message'),)", 'object_name': 'Vote'}, | ||
138 | + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
139 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
140 | + 'message': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['super_archives.Message']"}), | ||
141 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.User']"}) | ||
142 | + } | ||
143 | + } | ||
144 | + | ||
145 | + complete_apps = ['super_archives'] | ||
0 | \ No newline at end of file | 146 | \ No newline at end of file |
src/super_archives/models.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
2 | 2 | ||
3 | +from uuid import uuid4 | ||
3 | from hashlib import md5 | 4 | from hashlib import md5 |
4 | 5 | ||
5 | from django.db import models | 6 | from django.db import models |
@@ -25,6 +26,15 @@ class PageHit(models.Model): | @@ -25,6 +26,15 @@ class PageHit(models.Model): | ||
25 | hit_count = models.IntegerField(default=0) | 26 | hit_count = models.IntegerField(default=0) |
26 | 27 | ||
27 | 28 | ||
29 | +class EmailAddressValidation(models.Model): | ||
30 | + address = models.EmailField(unique=True) | ||
31 | + user = models.ForeignKey(User, null=True, | ||
32 | + related_name='emails_not_validated') | ||
33 | + validation_key = models.CharField(max_length=32, | ||
34 | + default=lambda: uuid4().hex) | ||
35 | + created = models.DateTimeField(auto_now_add=True) | ||
36 | + | ||
37 | + | ||
28 | class EmailAddress(models.Model): | 38 | class EmailAddress(models.Model): |
29 | user = models.ForeignKey(User, null=True, related_name='emails') | 39 | user = models.ForeignKey(User, null=True, related_name='emails') |
30 | address = models.EmailField(unique=True) | 40 | address = models.EmailField(unique=True) |