mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-12 14:00:17 +02:00
parent
97fe2ddfd0
commit
b7062c8dda
64
hrapplications/migrations/0004_remove_legacy_models.py
Normal file
64
hrapplications/migrations/0004_remove_legacy_models.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.2 on 2017-06-08 02:54
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def delete_permissions(apps, schema_editor):
|
||||
HRApplication = apps.get_model('hrapplications', 'HRApplication')
|
||||
HRApplicationComment = apps.get_model('hrapplications', 'HRApplicationComment')
|
||||
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||
Permission = apps.get_model('auth', 'Permission')
|
||||
ct1 = ContentType.objects.get_for_model(HRApplication)
|
||||
ct2 = ContentType.objects.get_for_model(HRApplicationComment)
|
||||
Permission.objects.filter(content_type__in=[ct1, ct2]).delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('hrapplications', '0003_sorted_questions'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplication',
|
||||
name='corp',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplication',
|
||||
name='reviewer_character',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplication',
|
||||
name='reviewer_inprogress_character',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplication',
|
||||
name='reviewer_user',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplication',
|
||||
name='user',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplicationcomment',
|
||||
name='application',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplicationcomment',
|
||||
name='commenter_character',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='hrapplicationcomment',
|
||||
name='commenter_user',
|
||||
),
|
||||
migrations.RunPython(delete_permissions, migrations.RunPython.noop),
|
||||
migrations.DeleteModel(
|
||||
name='HRApplication',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='HRApplicationComment',
|
||||
),
|
||||
]
|
@ -83,40 +83,3 @@ class ApplicationComment(models.Model):
|
||||
|
||||
def __str__(self):
|
||||
return str(self.user) + " comment on " + str(self.application)
|
||||
|
||||
|
||||
################
|
||||
# Legacy Models
|
||||
################
|
||||
@python_2_unicode_compatible
|
||||
class HRApplication(models.Model):
|
||||
character_name = models.CharField(max_length=254, default="")
|
||||
full_api_id = models.CharField(max_length=254, default="")
|
||||
full_api_key = models.CharField(max_length=254, default="")
|
||||
is_a_spi = models.CharField(max_length=254, default="")
|
||||
about = models.TextField(default="")
|
||||
extra = models.TextField(default="")
|
||||
|
||||
corp = models.ForeignKey(EveCorporationInfo)
|
||||
user = models.ForeignKey(User)
|
||||
|
||||
approved_denied = models.NullBooleanField(blank=True, null=True)
|
||||
reviewer_user = models.ForeignKey(User, blank=True, null=True, related_name="review_user")
|
||||
reviewer_character = models.ForeignKey(EveCharacter, blank=True, null=True)
|
||||
reviewer_inprogress_character = models.ForeignKey(EveCharacter, blank=True, null=True,
|
||||
related_name="inprogress_character")
|
||||
|
||||
def __str__(self):
|
||||
return self.character_name + " - Application"
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class HRApplicationComment(models.Model):
|
||||
created_on = models.DateTimeField(auto_now_add=True, null=True)
|
||||
comment = models.CharField(max_length=254, default="")
|
||||
application = models.ForeignKey(HRApplication)
|
||||
commenter_user = models.ForeignKey(User)
|
||||
commenter_character = models.ForeignKey(EveCharacter)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.application.character_name) + " - Comment"
|
||||
|
Loading…
x
Reference in New Issue
Block a user