diff --git a/.gitignore b/.gitignore index bd9d4c7..029040e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ distribute-*.tar.gz *.bak *.swp _public_html/ +celerybeat-schedule diff --git a/celerybeat-schedule b/celerybeat-schedule deleted file mode 100644 index 5a09f07..0000000 Binary files a/celerybeat-schedule and /dev/null differ diff --git a/project/customer/admin.py b/project/customer/admin.py index ec024c2..31b2811 100644 --- a/project/customer/admin.py +++ b/project/customer/admin.py @@ -6,12 +6,12 @@ import models class UserProfileAdmin(admin.ModelAdmin): - list_display = ('user', 'profile_type', 'name', 'inn', 'active') + list_display = ('get_email', 'profile_type', 'name', 'inn', 'active') list_display_links = list_display form = forms.UserProfileAdminForm class LicenseAdmin(admin.ModelAdmin): - list_display = ('user', 'term', 'status', 'order_date', 'date_from', 'date_to') + list_display = ('get_email', 'term', 'status', 'order_date', 'date_from', 'date_to') list_display_links = list_display diff --git a/project/customer/migrations/0008_auto__add_field_userprofile_confirmed.py b/project/customer/migrations/0008_auto__add_field_userprofile_confirmed.py new file mode 100644 index 0000000..be8af20 --- /dev/null +++ b/project/customer/migrations/0008_auto__add_field_userprofile_confirmed.py @@ -0,0 +1,181 @@ +# -*- 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): + # Adding field 'UserProfile.confirmed' + db.add_column(u'customer_userprofile', 'confirmed', + self.gf('django.db.models.fields.BooleanField')(default=False), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'UserProfile.confirmed' + db.delete_column(u'customer_userprofile', 'confirmed') + + + models = { + 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'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': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + u'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': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 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'}) + }, + u'customer.bankaccount': { + 'Meta': {'ordering': "['-created_at']", 'object_name': 'BankAccount'}, + 'account': ('django.db.models.fields.CharField', [], {'max_length': '20'}), + 'address': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'bik': ('django.db.models.fields.CharField', [], {'max_length': '10'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_main': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'korr_account': ('django.db.models.fields.CharField', [], {'max_length': '20'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bank_accounts'", 'to': u"orm['auth.User']"}) + }, + u'customer.client': { + 'Meta': {'ordering': "['name', '-created_at']", 'object_name': 'Client'}, + 'address': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'bank_account': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'bank_address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'bank_bik': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'bank_korr_account': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'bank_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'contact_email': ('django.db.models.fields.EmailField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'contact_icq': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'contact_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'contact_other': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'contact_phone': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'contact_skype': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'inn': ('django.db.models.fields.CharField', [], {'max_length': '12'}), + 'kpp': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '9', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'okpo': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'clients'", 'to': u"orm['auth.User']"}) + }, + u'customer.license': { + 'Meta': {'object_name': 'License'}, + 'date_from': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'date_to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'order_date': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'paid_date': ('django.db.models.fields.DateField', [], {'null': 'True'}), + 'pay_sum': ('django.db.models.fields.IntegerField', [], {}), + 'payform': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'status': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'term': ('django.db.models.fields.IntegerField', [], {}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'licenses'", 'to': u"orm['auth.User']"}) + }, + u'customer.licenseprice': { + 'Meta': {'object_name': 'LicensePrice'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'payform': ('django.db.models.fields.IntegerField', [], {}), + 'price': ('django.db.models.fields.IntegerField', [], {}), + 'term': ('django.db.models.fields.IntegerField', [], {}) + }, + u'customer.userprofile': { + 'Meta': {'object_name': 'UserProfile'}, + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'boss_midname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30'}), + 'boss_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30'}), + 'boss_sign': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'boss_surname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30'}), + 'boss_title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'confirmed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'default': "''", 'max_length': '75', 'blank': 'True'}), + 'fax': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'fax_code': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'full_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'glavbuh_midname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30', 'blank': 'True'}), + 'glavbuh_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30', 'blank': 'True'}), + 'glavbuh_sign': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'glavbuh_surname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30', 'blank': 'True'}), + 'inn': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '12'}), + 'ip_reg_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'jur_address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'kpp': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '9'}), + 'logo': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'na_osnovanii': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'ogrn': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '15'}), + 'okpo': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'phone': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'phone_code': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'profile_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {}), + 'real_address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'site': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'stamp': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'svid_gos_reg': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'primary_key': 'True', 'to': u"orm['auth.User']"}) + }, + u'customer.userprofilefilters': { + 'Meta': {'object_name': 'UserProfileFilters'}, + 'bank_account': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'+'", 'null': 'True', 'blank': 'True', 'to': u"orm['customer.BankAccount']"}), + 'show_bank_account': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_contact_info': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_email': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_fax': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_full_name': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_glavbuh': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_inn': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_ip_boss_fio': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_ip_reg_date': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_jur_address': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_kpp': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_na_osnovanii': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_name': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_ogrn': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_okpo': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_org_boss_title_and_fio': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_phone': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_profile_type': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_real_address': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_site': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_svid_gos_reg': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile_filters'", 'unique': 'True', 'primary_key': 'True', 'to': u"orm['auth.User']"}) + } + } + + complete_apps = ['customer'] \ No newline at end of file diff --git a/project/customer/migrations/0009_auto__del_field_licenseprice_payform.py b/project/customer/migrations/0009_auto__del_field_licenseprice_payform.py new file mode 100644 index 0000000..5914c79 --- /dev/null +++ b/project/customer/migrations/0009_auto__del_field_licenseprice_payform.py @@ -0,0 +1,180 @@ +# -*- 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 'LicensePrice.payform' + db.delete_column(u'customer_licenseprice', 'payform') + + + def backwards(self, orm): + # Adding field 'LicensePrice.payform' + db.add_column(u'customer_licenseprice', 'payform', + self.gf('django.db.models.fields.IntegerField')(default=0), + keep_default=False) + + + models = { + 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'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': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + u'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': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 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'}) + }, + u'customer.bankaccount': { + 'Meta': {'ordering': "['-created_at']", 'object_name': 'BankAccount'}, + 'account': ('django.db.models.fields.CharField', [], {'max_length': '20'}), + 'address': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'bik': ('django.db.models.fields.CharField', [], {'max_length': '10'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_main': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'korr_account': ('django.db.models.fields.CharField', [], {'max_length': '20'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bank_accounts'", 'to': u"orm['auth.User']"}) + }, + u'customer.client': { + 'Meta': {'ordering': "['name', '-created_at']", 'object_name': 'Client'}, + 'address': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'bank_account': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'bank_address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'bank_bik': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'bank_korr_account': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'bank_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'contact_email': ('django.db.models.fields.EmailField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'contact_icq': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'contact_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'contact_other': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'contact_phone': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'contact_skype': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'inn': ('django.db.models.fields.CharField', [], {'max_length': '12'}), + 'kpp': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '9', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}), + 'okpo': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'clients'", 'to': u"orm['auth.User']"}) + }, + u'customer.license': { + 'Meta': {'object_name': 'License'}, + 'date_from': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'date_to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'order_date': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'paid_date': ('django.db.models.fields.DateField', [], {'null': 'True'}), + 'pay_sum': ('django.db.models.fields.IntegerField', [], {}), + 'payform': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'status': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'term': ('django.db.models.fields.IntegerField', [], {}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'licenses'", 'to': u"orm['auth.User']"}) + }, + u'customer.licenseprice': { + 'Meta': {'object_name': 'LicensePrice'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'price': ('django.db.models.fields.IntegerField', [], {}), + 'term': ('django.db.models.fields.IntegerField', [], {}) + }, + u'customer.userprofile': { + 'Meta': {'object_name': 'UserProfile'}, + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'boss_midname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30'}), + 'boss_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30'}), + 'boss_sign': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'boss_surname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30'}), + 'boss_title': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'confirmed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'default': "''", 'max_length': '75', 'blank': 'True'}), + 'fax': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'fax_code': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'full_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'glavbuh_midname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30', 'blank': 'True'}), + 'glavbuh_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30', 'blank': 'True'}), + 'glavbuh_sign': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'glavbuh_surname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '30', 'blank': 'True'}), + 'inn': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '12'}), + 'ip_reg_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'jur_address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'kpp': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '9'}), + 'logo': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'na_osnovanii': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'ogrn': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '15'}), + 'okpo': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'phone': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '20', 'blank': 'True'}), + 'phone_code': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10', 'blank': 'True'}), + 'profile_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {}), + 'real_address': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'site': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'stamp': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), + 'svid_gos_reg': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), + 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'primary_key': 'True', 'to': u"orm['auth.User']"}) + }, + u'customer.userprofilefilters': { + 'Meta': {'object_name': 'UserProfileFilters'}, + 'bank_account': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'+'", 'null': 'True', 'blank': 'True', 'to': u"orm['customer.BankAccount']"}), + 'show_bank_account': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_contact_info': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_email': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_fax': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_full_name': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_glavbuh': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_inn': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_ip_boss_fio': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_ip_reg_date': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_jur_address': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_kpp': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_na_osnovanii': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_name': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_ogrn': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_okpo': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_org_boss_title_and_fio': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_phone': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_profile_type': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_real_address': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_site': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'show_svid_gos_reg': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile_filters'", 'unique': 'True', 'primary_key': 'True', 'to': u"orm['auth.User']"}) + } + } + + complete_apps = ['customer'] \ No newline at end of file diff --git a/project/customer/models.py b/project/customer/models.py index 5c82640..cc80dd2 100644 --- a/project/customer/models.py +++ b/project/customer/models.py @@ -101,6 +101,7 @@ class UserProfile(models.Model): created_at = models.DateTimeField(u'Создан', auto_now_add=True) updated_at = models.DateTimeField(u'Изменен', auto_now=True) active = models.BooleanField(u'Активен', default=False) + confirmed = models.BooleanField(u'Подтверждён', default=False) objects = managers.UserProfileManager() @@ -196,6 +197,9 @@ class UserProfile(models.Model): phone_code = u'(%s)' % phone_code if phone_code else phone_code return (u'%s %s' % (phone_code, self.phone,)).strip() + def get_email(self): + return self.user.email + def get_full_fax(self): """(Код города) Номер факса.""" fax_code = self.fax_code.strip('() ') @@ -380,6 +384,8 @@ class License(models.Model): super(License, self).save(*args, **kwargs) + def get_email(self): + return self.user.email def get_action(self): if self.status == 0: if self.payform == 0: @@ -401,8 +407,6 @@ class License(models.Model): class LicensePrice(models.Model): - payform = models.IntegerField(verbose_name=u'форма оплаты', - choices=consts.PAYFORMS) term = models.IntegerField(verbose_name=u'срок лицензии', choices=consts.TERMS) price = models.IntegerField(verbose_name=u'сумма оплаты') diff --git a/project/customer/views/bank_accounts.py b/project/customer/views/bank_accounts.py index 7e01a4d..3327036 100644 --- a/project/customer/views/bank_accounts.py +++ b/project/customer/views/bank_accounts.py @@ -11,7 +11,6 @@ from ..decorators import license_required @login_required -@license_required @csrf_protect @save_per_page_value def bank_accounts_list(request, page_num=None): @@ -23,7 +22,6 @@ def bank_accounts_list(request, page_num=None): @login_required -@license_required @csrf_protect def bank_accounts_add(request): """Добавить расчетный счет.""" @@ -56,7 +54,6 @@ def bank_accounts_add(request): @login_required -@license_required @csrf_protect def bank_accounts_edit(request, id): """Редактировать расчетный счет.""" @@ -90,7 +87,6 @@ def bank_accounts_edit(request, id): @login_required -@license_required @csrf_protect def bank_accounts_delete(request, id): """Удалить расчетный счет.""" diff --git a/project/customer/views/bank_accounts_ajax.py b/project/customer/views/bank_accounts_ajax.py index 9107ac7..7216bee 100644 --- a/project/customer/views/bank_accounts_ajax.py +++ b/project/customer/views/bank_accounts_ajax.py @@ -15,7 +15,6 @@ from ..decorators import license_required @login_required -@license_required def bank_accounts_list_ajax(request): """Список расчетных счетов пользователя - AJAX.""" if not request.is_ajax(): @@ -33,7 +32,6 @@ def bank_accounts_list_ajax(request): @login_required -@license_required def bank_accounts_get_ajax(request, id): """Получить счёт - AJAX. Если в форме редактирования счёта задан атрибут Meta.fields, то дампит только поля, перечисленные в нём. @@ -54,7 +52,6 @@ def bank_accounts_get_ajax(request, id): @login_required -@license_required @require_POST @csrf_protect def bank_accounts_add_ajax(request): @@ -83,7 +80,6 @@ def bank_accounts_add_ajax(request): @login_required -@license_required @require_POST @csrf_protect def bank_accounts_edit_ajax(request, id): @@ -112,7 +108,6 @@ def bank_accounts_edit_ajax(request, id): @login_required -@license_required @require_POST @csrf_protect def bank_accounts_delete_ajax(request, id): diff --git a/project/customer/views/clients.py b/project/customer/views/clients.py index 39fa776..871e3ed 100644 --- a/project/customer/views/clients.py +++ b/project/customer/views/clients.py @@ -10,7 +10,6 @@ from ..decorators import license_required @login_required -@license_required @csrf_protect @save_per_page_value def clients_list(request, page_num=None): diff --git a/project/customer/views/clients_ajax.py b/project/customer/views/clients_ajax.py index b4c07d2..eae393f 100644 --- a/project/customer/views/clients_ajax.py +++ b/project/customer/views/clients_ajax.py @@ -12,7 +12,6 @@ from ..decorators import license_required @login_required -@license_required def clients_get_ajax(request, id): """Получить контрагента - AJAX. Если в форме редактирования контрагента задан атрибут Meta.fields, то дампит только поля, перечисленные в нём. @@ -32,7 +31,6 @@ def clients_get_ajax(request, id): @login_required -@license_required @require_POST @csrf_protect def clients_add_ajax(request): @@ -69,7 +67,6 @@ def clients_add_ajax(request): @login_required -@license_required @require_POST @csrf_protect def clients_edit_ajax(request, id): @@ -99,7 +96,6 @@ def clients_edit_ajax(request, id): @login_required -@license_required @require_POST @csrf_protect def clients_delete_ajax(request, id): diff --git a/project/customer/views/profile.py b/project/customer/views/profile.py index ca12438..3f69a0b 100644 --- a/project/customer/views/profile.py +++ b/project/customer/views/profile.py @@ -21,7 +21,6 @@ SUPPORT_EMAIL = getattr(settings, 'SUPPORT_EMAIL', '') # ----------------------------------------------------------------------------- -@license_required @login_required @csrf_protect def profile_view(request): @@ -59,7 +58,6 @@ def profile_view(request): @login_required -@license_required @csrf_protect def profile_edit(request): """Редактировать профиль пользователя.""" @@ -93,7 +91,6 @@ def profile_edit(request): @login_required -@license_required def _profile_get_pdf(request, profile=None, account=None, filters=None): """Создать профиль пользователя в PDF и вернуть как строку.""" template_name = 'customer/profile/as_pdf.html' @@ -106,7 +103,6 @@ def _profile_get_pdf(request, profile=None, account=None, filters=None): @login_required -@license_required def profile_as_pdf(request, profile=None, account=None, filters=None): """Вывести профиль пользователя в формате PDF в HttpResponse.""" pdf = _profile_get_pdf(request, profile, account, filters) diff --git a/project/customer/views/profile_ajax.py b/project/customer/views/profile_ajax.py index 09084a0..500f3fb 100644 --- a/project/customer/views/profile_ajax.py +++ b/project/customer/views/profile_ajax.py @@ -14,7 +14,6 @@ from .profile import _send_profile_email, _profile_get_pdf @login_required -@license_required @require_POST @csrf_protect def profile_filters_edit_ajax(request): @@ -45,7 +44,6 @@ def profile_filters_edit_ajax(request): @login_required -@license_required @require_POST @csrf_protect def profile_email_ajax(request): diff --git a/project/docs/views/base_views.py b/project/docs/views/base_views.py index 629e416..bee6792 100644 --- a/project/docs/views/base_views.py +++ b/project/docs/views/base_views.py @@ -184,7 +184,6 @@ class BaseViews(object): dictionary['clients_form'] = ClientsListForm(self.request.user) dictionary['invoices_form'] = InvoicesListForm(self.request.user) - @method_decorator(license_required) @method_decorator(csrf_protect) @method_decorator(save_per_page_value) def list(self, *args, **kwargs): @@ -281,7 +280,6 @@ class BaseViews(object): kwargs['initial'].pop('updated_at', None) return self.add(self.request, *args, **kwargs) - @method_decorator(license_required) @method_decorator(csrf_protect) def edit(self, *args, **kwargs): """Редактировать документ.""" @@ -311,7 +309,6 @@ class BaseViews(object): } return render(self.request, self.TEMPLATE_EDIT, dictionary) - @method_decorator(license_required) @method_decorator(csrf_protect) def delete(self, *args, **kwargs): """Удалить документ.""" @@ -440,7 +437,6 @@ class BaseViews(object): ) return False # что-то пошло не так - @method_decorator(license_required) @method_decorator(csrf_protect) def email(self, *args, **kwargs): """Отправить документ на email аттачем в заданном формате.""" @@ -651,7 +647,6 @@ class BaseItemsViews(BaseViews): return self.add(self.request, *args, **kwargs) - @method_decorator(license_required) @method_decorator(csrf_protect) def edit(self, *args, **kwargs): """Редактировать документ.""" diff --git a/project/myauth/forms.py b/project/myauth/forms.py index 66a0588..1cd3674 100644 --- a/project/myauth/forms.py +++ b/project/myauth/forms.py @@ -155,7 +155,7 @@ class LoginForm(forms.Form): if self.user_cache: if not self.user_cache.is_active: set_field_error(self, 'email', u'Пользователь заблокирован.') - if not self.user_cache.profile.active: + if not self.user_cache.profile.confirmed: set_field_error(self, 'email', u'E-mail не подтверждён.') else: set_field_error(self, 'password', u'Неверное сочетание e-mail / пароль.') diff --git a/project/myauth/views.py b/project/myauth/views.py index 355f629..363c3d7 100644 --- a/project/myauth/views.py +++ b/project/myauth/views.py @@ -99,6 +99,7 @@ def confirm_registered_email(request, key): term=0, status=-1, payform=-1) license.save() + user.profile.confirmed = True user.profile.active = True user.profile.save()