Commit 1ac10f36 authored by Enrico Zini's avatar Enrico Zini
Browse files

Migrated out of south

parent 72a1d409
......@@ -11,7 +11,7 @@ from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
('auth', '0006_require_contenttypes_0002'),
]
operations = [
......@@ -20,30 +20,29 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(unique=True, max_length=255)),
('username', models.CharField(help_text='Debian SSO username', unique=True, max_length=255)),
('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('is_staff', models.BooleanField(default=False)),
('cn', models.CharField(max_length=250, verbose_name='first name')),
('mn', models.CharField(max_length=250, null=True, verbose_name='middle name', blank=True)),
('sn', models.CharField(max_length=250, null=True, verbose_name='last name', blank=True)),
('email', models.EmailField(unique=True, max_length=75, verbose_name='email address')),
('bio', backend.models.TextNullField(help_text='Please enter here a short biographical information', null=True, verbose_name='short biography', blank=True)),
('mn', models.CharField(default='', max_length=250, verbose_name='middle name', blank=True)),
('sn', models.CharField(default='', max_length=250, verbose_name='last name', blank=True)),
('email', models.EmailField(unique=True, max_length=254, verbose_name='email address')),
('bio', models.TextField(default='', help_text='Please enter here a short biographical information', verbose_name='short biography', blank=True)),
('uid', backend.models.CharNullField(max_length=32, unique=True, null=True, verbose_name='Debian account name', blank=True)),
('fpr', backend.models.FingerprintField(max_length=40, unique=True, null=True, verbose_name='OpenPGP key fingerprint', blank=True)),
('status', models.CharField(max_length=20, verbose_name='current status in the project', choices=[('dc', 'Debian Contributor'), ('dc_ga', 'Debian Contributor, with guest account'), ('dm', 'Debian Maintainer'), ('dm_ga', 'Debian Maintainer, with guest account'), ('dd_u', 'Debian Developer, uploading'), ('dd_nu', 'Debian Developer, non-uploading'), ('dd_e', 'Debian Developer, emeritus'), ('dm_e', 'Debian Maintainer, emeritus'), ('dd_r', 'Debian Developer, removed'), ('dm_r', 'Debian Maintainer, removed')])),
('status', models.CharField(max_length=20, verbose_name='current status in the project', choices=[('dc', 'Debian Contributor'), ('dc_ga', 'Debian Contributor, with guest account'), ('dm', 'Debian Maintainer'), ('dm_ga', 'Debian Maintainer, with guest account'), ('dd_u', 'Debian Developer, uploading'), ('dd_nu', 'Debian Developer, non-uploading'), ('dd_e', 'Debian Developer, emeritus'), ('dm_e', 'Debian Maintainer, emeritus'), ('dd_r', 'Debian Developer, removed'), ('dm_r', 'Debian Maintainer, removed'), ('dc_ga_r', 'Debian Contributor, with closed guest account')])),
('status_changed', models.DateTimeField(default=datetime.datetime.utcnow, verbose_name='when the status last changed')),
('fd_comment', models.TextField(null=True, verbose_name='Front Desk comments', blank=True)),
('fd_comment', models.TextField(default='', verbose_name='Front Desk comments', blank=True)),
('created', models.DateTimeField(default=datetime.datetime.utcnow, null=True, verbose_name='Person record created')),
('expires', models.DateField(default=None, help_text='This person will be deleted after this date if the status is still dc and no Process has started', null=True, verbose_name='Expiration date for the account', blank=True)),
('pending', models.CharField(max_length=255, verbose_name='Nonce used to confirm this pending record', blank=True)),
('groups', models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Group', blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of his/her group.', verbose_name='groups')),
('groups', models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Group', blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', verbose_name='groups')),
('user_permissions', models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Permission', blank=True, help_text='Specific permissions for this user.', verbose_name='user permissions')),
],
options={
'db_table': 'person',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='AM',
......@@ -55,12 +54,12 @@ class Migration(migrations.Migration):
('is_dam', models.BooleanField(default=False, verbose_name='DAM')),
('is_am_ctte', models.BooleanField(default=False, verbose_name='NM CTTE member')),
('created', models.DateTimeField(default=datetime.datetime.utcnow, null=True, verbose_name='AM record created')),
('fd_comment', models.TextField(default='', verbose_name='Front Desk comments', blank=True)),
('person', models.OneToOneField(related_name='am', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'am',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Log',
......@@ -69,20 +68,30 @@ class Migration(migrations.Migration):
('progress', models.CharField(max_length=20, choices=[('app_new', 'Applicant asked to enter the process'), ('app_rcvd', 'Applicant replied to initial mail'), ('app_hold', 'On hold before entering the queue'), ('adv_rcvd', 'Received enough advocacies'), ('poll_sent', 'Activity poll sent'), ('app_ok', 'Advocacies have been approved'), ('am_rcvd', 'Waiting for AM to confirm'), ('am', 'Interacting with an AM'), ('am_hold', 'AM hold'), ('am_ok', 'AM approved'), ('fd_hold', 'FD hold'), ('fd_ok', 'FD approved'), ('dam_hold', 'DAM hold'), ('dam_ok', 'DAM approved'), ('done', 'Completed'), ('cancelled', 'Cancelled')])),
('is_public', models.BooleanField(default=False)),
('logdate', models.DateTimeField(default=datetime.datetime.utcnow)),
('logtext', backend.models.TextNullField(null=True, blank=True)),
('logtext', models.TextField(default='', blank=True)),
('changed_by', models.ForeignKey(related_name='log_written', to=settings.AUTH_USER_MODEL, null=True)),
],
options={
'db_table': 'log',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='PersonAuditLog',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('logdate', models.DateTimeField(auto_now_add=True)),
('notes', models.TextField(default='')),
('changes', models.TextField(default='{}')),
('author', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL)),
('person', models.ForeignKey(related_name='audit_log', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Process',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('applying_as', models.CharField(max_length=20, verbose_name='original status', choices=[('dc', 'DC'), ('dc_ga', 'DC+account'), ('dm', 'DM'), ('dm_ga', 'DM+account'), ('dd_u', 'DD, upl.'), ('dd_nu', 'DD, non-upl.'), ('dd_e', 'DD, emeritus'), ('dm_e', 'DM, emeritus'), ('dd_r', 'DD, removed'), ('dm_r', 'DM, removed')])),
('applying_for', models.CharField(max_length=20, verbose_name='target status', choices=[('dc', 'DC'), ('dc_ga', 'DC+account'), ('dm', 'DM'), ('dm_ga', 'DM+account'), ('dd_u', 'DD, upl.'), ('dd_nu', 'DD, non-upl.'), ('dd_e', 'DD, emeritus'), ('dm_e', 'DM, emeritus'), ('dd_r', 'DD, removed'), ('dm_r', 'DM, removed')])),
('applying_as', models.CharField(max_length=20, verbose_name='original status', choices=[('dc', 'DC'), ('dc_ga', 'DC+account'), ('dm', 'DM'), ('dm_ga', 'DM+account'), ('dd_u', 'DD, upl.'), ('dd_nu', 'DD, non-upl.'), ('dd_e', 'DD, emeritus'), ('dm_e', 'DM, emeritus'), ('dd_r', 'DD, removed'), ('dm_r', 'DM, removed'), ('dc_ga_r', 'DC+closed acct.')])),
('applying_for', models.CharField(max_length=20, verbose_name='target status', choices=[('dc', 'DC'), ('dc_ga', 'DC+account'), ('dm', 'DM'), ('dm_ga', 'DM+account'), ('dd_u', 'DD, upl.'), ('dd_nu', 'DD, non-upl.'), ('dd_e', 'DD, emeritus'), ('dm_e', 'DM, emeritus'), ('dd_r', 'DD, removed'), ('dm_r', 'DM, removed'), ('dc_ga_r', 'DC+closed acct.')])),
('progress', models.CharField(max_length=20, choices=[('app_new', 'Applied'), ('app_rcvd', 'Validated'), ('app_hold', 'App hold'), ('adv_rcvd', 'Adv ok'), ('poll_sent', 'Poll sent'), ('app_ok', 'App ok'), ('am_rcvd', 'AM assigned'), ('am', 'AM'), ('am_hold', 'AM hold'), ('am_ok', 'AM ok'), ('fd_hold', 'FD hold'), ('fd_ok', 'FD ok'), ('dam_hold', 'DAM hold'), ('dam_ok', 'DAM ok'), ('done', 'Done'), ('cancelled', 'Cancelled')])),
('is_active', models.BooleanField(default=False)),
('archive_key', models.CharField(unique=True, max_length=128, verbose_name='mailbox archive key')),
......@@ -93,12 +102,10 @@ class Migration(migrations.Migration):
options={
'db_table': 'process',
},
bases=(models.Model,),
),
migrations.AddField(
model_name='log',
name='process',
field=models.ForeignKey(related_name='log', to='backend.Process'),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='PersonAuditLog',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('logdate', models.DateTimeField(auto_now_add=True)),
('notes', models.TextField(default='')),
('changes', models.TextField(default='{}')),
('author', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL)),
('person', models.ForeignKey(related_name='audit_log', to=settings.AUTH_USER_MODEL)),
],
options={
},
bases=(models.Model,),
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0002_personauditlog'),
]
operations = [
migrations.AlterField(
model_name='log',
name='logtext',
field=models.TextField(default='', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='person',
name='bio',
field=models.TextField(default='', help_text='Please enter here a short biographical information', verbose_name='short biography', blank=True),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0003_auto_20150509_1517'),
]
operations = [
migrations.AlterField(
model_name='person',
name='fd_comment',
field=models.TextField(default='', verbose_name='Front Desk comments', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='person',
name='mn',
field=models.CharField(default='', max_length=250, verbose_name='middle name', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='person',
name='sn',
field=models.CharField(default='', max_length=250, verbose_name='last name', blank=True),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0004_auto_20150509_1544'),
]
operations = [
migrations.AlterField(
model_name='person',
name='status',
field=models.CharField(max_length=20, verbose_name='current status in the project', choices=[('dc', 'Debian Contributor'), ('dc_ga', 'Debian Contributor, with guest account'), ('dm', 'Debian Maintainer'), ('dm_ga', 'Debian Maintainer, with guest account'), ('dd_u', 'Debian Developer, uploading'), ('dd_nu', 'Debian Developer, non-uploading'), ('dd_e', 'Debian Developer, emeritus'), ('dm_e', 'Debian Maintainer, emeritus'), ('dd_r', 'Debian Developer, removed'), ('dm_r', 'Debian Maintainer, removed'), ('dc_ga_r', 'Debian Contributor, with closed guest account')]),
preserve_default=True,
),
migrations.AlterField(
model_name='process',
name='applying_as',
field=models.CharField(max_length=20, verbose_name='original status', choices=[('dc', 'DC'), ('dc_ga', 'DC+account'), ('dm', 'DM'), ('dm_ga', 'DM+account'), ('dd_u', 'DD, upl.'), ('dd_nu', 'DD, non-upl.'), ('dd_e', 'DD, emeritus'), ('dm_e', 'DM, emeritus'), ('dd_r', 'DD, removed'), ('dm_r', 'DM, removed'), ('dc_ga_r', 'DC+closed acct.')]),
preserve_default=True,
),
migrations.AlterField(
model_name='process',
name='applying_for',
field=models.CharField(max_length=20, verbose_name='target status', choices=[('dc', 'DC'), ('dc_ga', 'DC+account'), ('dm', 'DM'), ('dm_ga', 'DM+account'), ('dd_u', 'DD, upl.'), ('dd_nu', 'DD, non-upl.'), ('dd_e', 'DD, emeritus'), ('dm_e', 'DM, emeritus'), ('dd_r', 'DD, removed'), ('dm_r', 'DM, removed'), ('dc_ga_r', 'DC+closed acct.')]),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0005_auto_20150512_1511'),
]
operations = [
migrations.AddField(
model_name='am',
name='fd_comment',
field=models.TextField(default='', verbose_name='Front Desk comments', blank=True),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0006_am_fd_comment'),
]
operations = [
migrations.AlterField(
model_name='person',
name='username',
field=models.CharField(help_text='Debian SSO username', unique=True, max_length=255),
preserve_default=True,
),
]
......@@ -35,7 +35,6 @@ import urllib
import os.path
import re
import json
from south.modelsinspector import add_introspection_rules
from django.db.models.signals import post_save
......@@ -80,31 +79,6 @@ class CharNullField(models.CharField):
# otherwise, just pass the value
return value
class TextNullField(models.TextField):
# This class is not used anymore, but it is kept as it is used by old
# migrations.
description = "TextField that stores NULL but returns ''"
# this is the value right out of the db, or an instance
def to_python(self, value):
if isinstance(value, models.TextField): # if an instance, just return the instance
return value
if value is None:
# if the db has a NULL, convert it into the Django-friendly '' string
return ""
else:
# otherwise, return just the value
return value
# catches value right before sending to db
def get_db_prep_value(self, value, connection, prepared=False):
if value=="":
# if Django tries to save '' string, send the db None (NULL)
return None
else:
# otherwise, just pass the value
return value
class FingerprintField(models.CharField):
description = "CharField that stores NULL but returns '', also strip spaces and upper storing"
......@@ -146,12 +120,6 @@ class FingerprintField(models.CharField):
return super(FingerprintField, self).formfield(**kwargs)
## for south migrations of customs fields,
## no kwargs in constructors allow us to cite only the names
add_introspection_rules(
[], ["^backend\.models\.CharNullField",
"^backend\.models\.FingerprintField"])
class PersonVisitorPermissions(object):
"""
Store NM-specific permissions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment