actually remove reviewed field plus required migrations

admin-improvements
Nate Smith 2019-07-15 21:10:35 -05:00
parent a2af7c5c96
commit e59bd893fd
4 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2019-07-16 01:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0012_auto_20190710_1622'),
]
operations = [
migrations.AddField(
model_name='townie',
name='state',
field=models.CharField(choices=[('3_rejected', 'Rejected'), ('2_accepted', 'Accepted'), ('0_unreviewed', 'Unreviewed'), ('4_permaban', 'Permanently Banned'), ('1_tempban', 'Temporarily Banned')], default='0_unreviewed', max_length=20),
),
migrations.AlterField(
model_name='townie',
name='notes',
field=models.TextField(blank=True, help_text='Use this field to share information about this user (reviewed or not) for other admins to see', null=True),
),
]

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2019-07-16 01:51
from __future__ import unicode_literals
from django.db import migrations
def set_state(apps, _):
Townie = apps.get_model('users', 'Townie')
for townie in Townie.objects.all():
if townie.reviewed:
townie.state = Townie.ACCEPTED
townie.save()
class Migration(migrations.Migration):
dependencies = [
('users', '0013_auto_20190716_0148'),
]
operations = [
migrations.RunPython(set_state)
]

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2019-07-16 02:10
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0014_auto_20190716_0151'),
]
operations = [
migrations.RemoveField(
model_name='townie',
name='reviewed',
),
]

View File

@ -58,7 +58,6 @@ class Townie(User):
) )
shell = CharField(max_length=50, default="/bin/bash") shell = CharField(max_length=50, default="/bin/bash")
state = CharField(max_length=20, choices=STATE_CHOICES, default=UNREVIEWED) state = CharField(max_length=20, choices=STATE_CHOICES, default=UNREVIEWED)
reviewed = BooleanField(default=False)
reasons = TextField(blank=True, null=False, default='') reasons = TextField(blank=True, null=False, default='')
plans = TextField(blank=True, null=False, default='') plans = TextField(blank=True, null=False, default='')
socials = TextField(blank=True, null=False, default='') socials = TextField(blank=True, null=False, default='')