mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Squash
This commit is contained in:
parent
91aad3b820
commit
389b958ca7
@ -8,6 +8,39 @@ from django.db import migrations, models
|
|||||||
import allianceauth.authentication.models
|
import allianceauth.authentication.models
|
||||||
|
|
||||||
|
|
||||||
|
def create_permissions(apps, schema_editor):
|
||||||
|
User = apps.get_model('auth', 'User')
|
||||||
|
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||||
|
Permission = apps.get_model('auth', 'Permission')
|
||||||
|
ct = ContentType.objects.get_for_model(User)
|
||||||
|
# Permission.objects.get_or_create(codename="member", content_type=ct, name="member")
|
||||||
|
# Permission.objects.get_or_create(codename="jabber_broadcast", content_type=ct, name="jabber_broadcast")
|
||||||
|
# Permission.objects.get_or_create(codename="jabber_broadcast_all", content_type=ct, name="jabber_broadcast_all")
|
||||||
|
# Permission.objects.get_or_create(codename="fleetactivitytracking", content_type=ct, name="fleetactivitytracking")
|
||||||
|
# Permission.objects.get_or_create(codename="fleetactivitytracking_statistics", content_type=ct, name="fleetactivitytracking_statistics")
|
||||||
|
# Permission.objects.get_or_create(codename="signature_management", content_type=ct, name="signature_management")
|
||||||
|
# Permission.objects.get_or_create(codename="signature_view", content_type=ct, name="signature_view")
|
||||||
|
# Permission.objects.get_or_create(codename="optimer_management", content_type=ct, name="optimer_management")
|
||||||
|
# Permission.objects.get_or_create(codename="optimer_view", content_type=ct, name="optimer_view")
|
||||||
|
Permission.objects.get_or_create(codename="logging_notifications", content_type=ct, name="logging_notifications")
|
||||||
|
|
||||||
|
|
||||||
|
def create_permissions_reverse(apps, schema_editor) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def create_states(apps, schema_editor) -> None:
|
||||||
|
State = apps.get_model('authentication', 'State')
|
||||||
|
|
||||||
|
State.objects.update_or_create(name="Guest", defaults={'priority': 0, 'public': True})[0]
|
||||||
|
State.objects.update_or_create(name="Blue", defaults={'priority': 50, 'public': False})[0]
|
||||||
|
State.objects.update_or_create(name="Member", defaults={'priority': 100, 'public': False})[0]
|
||||||
|
|
||||||
|
|
||||||
|
def create_states_reverse(apps, schema_editor) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
replaces = [('authentication', '0001_initial'), ('authentication', '0002_auto_20160907_1914'), ('authentication', '0003_authservicesinfo_state'), ('authentication', '0004_create_permissions'), ('authentication', '0005_delete_perms'), ('authentication', '0006_auto_20160910_0542'), ('authentication', '0007_remove_authservicesinfo_is_blue'), ('authentication', '0008_set_state'), ('authentication', '0009_auto_20161021_0228'), ('authentication', '0010_only_one_authservicesinfo'), ('authentication', '0011_authservicesinfo_user_onetoonefield'), ('authentication', '0012_remove_add_delete_authservicesinfo_permissions'), ('authentication', '0013_service_modules'), ('authentication', '0014_fleetup_permission'), ('authentication', '0015_user_profiles'), ('authentication', '0016_ownershiprecord'), ('authentication', '0017_remove_fleetup_permission'), ('authentication', '0018_state_member_factions'), ('authentication', '0018_alter_state_name_length'), ('authentication', '0019_merge_20211026_0919'), ('authentication', '0020_userprofile_language_userprofile_night_mode'), ('authentication', '0021_alter_userprofile_language'), ('authentication', '0022_userprofile_theme'), ('authentication', '0023_alter_userprofile_language'), ('authentication', '0024_alter_userprofile_language')]
|
replaces = [('authentication', '0001_initial'), ('authentication', '0002_auto_20160907_1914'), ('authentication', '0003_authservicesinfo_state'), ('authentication', '0004_create_permissions'), ('authentication', '0005_delete_perms'), ('authentication', '0006_auto_20160910_0542'), ('authentication', '0007_remove_authservicesinfo_is_blue'), ('authentication', '0008_set_state'), ('authentication', '0009_auto_20161021_0228'), ('authentication', '0010_only_one_authservicesinfo'), ('authentication', '0011_authservicesinfo_user_onetoonefield'), ('authentication', '0012_remove_add_delete_authservicesinfo_permissions'), ('authentication', '0013_service_modules'), ('authentication', '0014_fleetup_permission'), ('authentication', '0015_user_profiles'), ('authentication', '0016_ownershiprecord'), ('authentication', '0017_remove_fleetup_permission'), ('authentication', '0018_state_member_factions'), ('authentication', '0018_alter_state_name_length'), ('authentication', '0019_merge_20211026_0919'), ('authentication', '0020_userprofile_language_userprofile_night_mode'), ('authentication', '0021_alter_userprofile_language'), ('authentication', '0022_userprofile_theme'), ('authentication', '0023_alter_userprofile_language'), ('authentication', '0024_alter_userprofile_language')]
|
||||||
@ -15,6 +48,7 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
('esi', '0012_fix_token_type_choices'),
|
('esi', '0012_fix_token_type_choices'),
|
||||||
('eveonline', '0019_v5squash'),
|
('eveonline', '0019_v5squash'),
|
||||||
]
|
]
|
||||||
@ -106,4 +140,7 @@ class Migration(migrations.Migration):
|
|||||||
'ordering': ['-created'],
|
'ordering': ['-created'],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
migrations.RunPython(create_permissions, create_permissions_reverse),
|
||||||
|
migrations.RunPython(create_states, create_states_reverse),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 5.1.6 on 2025-03-04 03:06
|
# Generated by Django 5.1.6 on 2025-03-04 03:06
|
||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('auth', '__first__'),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -38,10 +39,10 @@ class Migration(migrations.Migration):
|
|||||||
('corporation_name', models.CharField(max_length=254)),
|
('corporation_name', models.CharField(max_length=254)),
|
||||||
('corporation_ticker', models.CharField(max_length=5)),
|
('corporation_ticker', models.CharField(max_length=5)),
|
||||||
('alliance_id', models.PositiveIntegerField(blank=True, default=None, null=True)),
|
('alliance_id', models.PositiveIntegerField(blank=True, default=None, null=True)),
|
||||||
('alliance_name', models.CharField(blank=True, default='', max_length=254)),
|
('alliance_name', models.CharField(blank=True, default='', max_length=254, null=True)),
|
||||||
('alliance_ticker', models.CharField(blank=True, default='', max_length=5)),
|
('alliance_ticker', models.CharField(blank=True, default='', max_length=5, null=True)),
|
||||||
('faction_id', models.PositiveIntegerField(blank=True, default=None, null=True)),
|
('faction_id', models.PositiveIntegerField(blank=True, default=None, null=True)),
|
||||||
('faction_name', models.CharField(blank=True, default='', max_length=254)),
|
('faction_name', models.CharField(blank=True, default='', max_length=254, null=True)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'indexes': [models.Index(fields=['corporation_id'], name='eveonline_e_corpora_cb4cd9_idx'), models.Index(fields=['alliance_id'], name='eveonline_e_allianc_39ee2a_idx'), models.Index(fields=['corporation_name'], name='eveonline_e_corpora_893c60_idx'), models.Index(fields=['alliance_name'], name='eveonline_e_allianc_63fd98_idx'), models.Index(fields=['faction_id'], name='eveonline_e_faction_d5274e_idx')],
|
'indexes': [models.Index(fields=['corporation_id'], name='eveonline_e_corpora_cb4cd9_idx'), models.Index(fields=['alliance_id'], name='eveonline_e_allianc_39ee2a_idx'), models.Index(fields=['corporation_name'], name='eveonline_e_corpora_893c60_idx'), models.Index(fields=['alliance_name'], name='eveonline_e_allianc_63fd98_idx'), models.Index(fields=['faction_id'], name='eveonline_e_faction_d5274e_idx')],
|
||||||
|
@ -15,8 +15,8 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('eveonline', '0019_v5squash'),
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('eveonline', '0019_v5squash'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
@ -7,6 +7,18 @@ from django.conf import settings
|
|||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
def create_permissions(apps, schema_editor):
|
||||||
|
User = apps.get_model('auth', 'User')
|
||||||
|
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||||
|
Permission = apps.get_model('auth', 'Permission')
|
||||||
|
ct = ContentType.objects.get_for_model(User)
|
||||||
|
Permission.objects.get_or_create(codename="group_management", content_type=ct, name="group_management")
|
||||||
|
|
||||||
|
|
||||||
|
def reverse(apps, schema_editor):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
replaces = [('groupmanagement', '0001_initial'), ('groupmanagement', '0002_auto_20160906_2354'), ('groupmanagement', '0003_default_groups'), ('groupmanagement', '0004_authgroup'), ('groupmanagement', '0005_authgroup_public'), ('groupmanagement', '0006_request_groups_perm'), ('groupmanagement', '0007_on_delete'), ('groupmanagement', '0008_remove_authgroup_permissions'), ('groupmanagement', '0009_requestlog'), ('groupmanagement', '0010_authgroup_states'), ('groupmanagement', '0011_requestlog_date'), ('groupmanagement', '0012_group_leads'), ('groupmanagement', '0013_fix_requestlog_date_field'), ('groupmanagement', '0014_auto_20200918_1412'), ('groupmanagement', '0015_make_descriptions_great_again'), ('groupmanagement', '0016_remove_grouprequest_status_field'), ('groupmanagement', '0017_improve_groups_documentation'), ('groupmanagement', '0018_reservedgroupname'), ('groupmanagement', '0019_adding_restricted_to_groups')]
|
replaces = [('groupmanagement', '0001_initial'), ('groupmanagement', '0002_auto_20160906_2354'), ('groupmanagement', '0003_default_groups'), ('groupmanagement', '0004_authgroup'), ('groupmanagement', '0005_authgroup_public'), ('groupmanagement', '0006_request_groups_perm'), ('groupmanagement', '0007_on_delete'), ('groupmanagement', '0008_remove_authgroup_permissions'), ('groupmanagement', '0009_requestlog'), ('groupmanagement', '0010_authgroup_states'), ('groupmanagement', '0011_requestlog_date'), ('groupmanagement', '0012_group_leads'), ('groupmanagement', '0013_fix_requestlog_date_field'), ('groupmanagement', '0014_auto_20200918_1412'), ('groupmanagement', '0015_make_descriptions_great_again'), ('groupmanagement', '0016_remove_grouprequest_status_field'), ('groupmanagement', '0017_improve_groups_documentation'), ('groupmanagement', '0018_reservedgroupname'), ('groupmanagement', '0019_adding_restricted_to_groups')]
|
||||||
@ -14,6 +26,7 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
('authentication', '0025_v5squash'),
|
('authentication', '0025_v5squash'),
|
||||||
('eveonline', '0019_v5squash'),
|
('eveonline', '0019_v5squash'),
|
||||||
]
|
]
|
||||||
@ -84,4 +97,5 @@ class Migration(migrations.Migration):
|
|||||||
('created_at', models.DateTimeField(default=django.utils.timezone.now, help_text='Date when this entry was created', verbose_name='created at')),
|
('created_at', models.DateTimeField(default=django.utils.timezone.now, help_text='Date when this entry was created', verbose_name='created at')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
migrations.RunPython(create_permissions, reverse)
|
||||||
]
|
]
|
||||||
|
@ -176,6 +176,9 @@ class AuthGroup(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
permissions = (
|
||||||
("request_groups", _("Can request non-public groups")),
|
("request_groups", _("Can request non-public groups")),
|
||||||
|
# Intentionally Commented out
|
||||||
|
# AAv0 has these in the Auth_ Content Type
|
||||||
|
# ('auth.group_management', 'Can Approve and Deny all Group Requests, Can view and manage all group memberships'))
|
||||||
)
|
)
|
||||||
default_permissions = ()
|
default_permissions = ()
|
||||||
|
|
||||||
|
99
allianceauth/hrapplications/migrations/0008_v5squash.py
Normal file
99
allianceauth/hrapplications/migrations/0008_v5squash.py
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
# Generated by Django 5.1.6 on 2025-03-04 04:31
|
||||||
|
|
||||||
|
import sortedm2m.fields
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
def create_permissions(apps, schema_editor):
|
||||||
|
User = apps.get_model('auth', 'User')
|
||||||
|
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||||
|
Permission = apps.get_model('auth', 'Permission')
|
||||||
|
ct = ContentType.objects.get_for_model(User)
|
||||||
|
Permission.objects.get_or_create(codename="human_resources", content_type=ct, name="human_resources")
|
||||||
|
|
||||||
|
|
||||||
|
def reverse(apps, schema_editor):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
replaces = [('hrapplications', '0001_initial'), ('hrapplications', '0002_choices_for_questions'), ('hrapplications', '0003_applicationquestion_multi_select'), ('hrapplications', '0004_make_strings_more_stringy'), ('hrapplications', '0005_sorted_questions'), ('hrapplications', '0006_remove_legacy_models'), ('hrapplications', '0007_auto_20200918_1412')]
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('eveonline', '0019_v5squash'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ApplicationQuestion',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('title', models.CharField(max_length=254, verbose_name='Question')),
|
||||||
|
('help_text', models.CharField(blank=True, max_length=254, null=True)),
|
||||||
|
('multi_select', models.BooleanField(default=False)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ApplicationForm',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('corp', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='eveonline.evecorporationinfo')),
|
||||||
|
('questions', sortedm2m.fields.SortedManyToManyField(help_text=None, to='hrapplications.applicationquestion')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ApplicationChoice',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('choice_text', models.CharField(max_length=200, verbose_name='Choice')),
|
||||||
|
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='choices', to='hrapplications.applicationquestion')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Application',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('approved', models.BooleanField(blank=True, default=None, null=True)),
|
||||||
|
('created', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applications', to='hrapplications.applicationform')),
|
||||||
|
('reviewer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
||||||
|
('reviewer_character', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='eveonline.evecharacter')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='applications', to=settings.AUTH_USER_MODEL)),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'permissions': (('approve_application', 'Can approve applications'), ('reject_application', 'Can reject applications'), ('view_apis', 'Can view applicant APIs')),
|
||||||
|
'unique_together': {('form', 'user')},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ApplicationComment',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('text', models.TextField()),
|
||||||
|
('created', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='hrapplications.application')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ApplicationResponse',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('answer', models.TextField()),
|
||||||
|
('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='responses', to='hrapplications.application')),
|
||||||
|
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hrapplications.applicationquestion')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'unique_together': {('question', 'application')},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.RunPython(create_permissions, reverse)
|
||||||
|
|
||||||
|
]
|
@ -2,9 +2,22 @@
|
|||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
def create_permissions(apps, schema_editor):
|
||||||
|
User = apps.get_model('auth', 'User')
|
||||||
|
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||||
|
Permission = apps.get_model('auth', 'Permission')
|
||||||
|
ct = ContentType.objects.get_for_model(User)
|
||||||
|
Permission.objects.get_or_create(codename="srp_management", content_type=ct, name="srp_management")
|
||||||
|
|
||||||
|
|
||||||
|
def reverse(apps, schema_editor):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
replaces = [('srp', '0001_initial'), ('srp', '0002_srpuserrequest_srp_status_choices'), ('srp', '0003_make_strings_more_stringy'), ('srp', '0004_on_delete')]
|
replaces = [('srp', '0001_initial'), ('srp', '0002_srpuserrequest_srp_status_choices'), ('srp', '0003_make_strings_more_stringy'), ('srp', '0004_on_delete')]
|
||||||
@ -12,7 +25,8 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('eveonline', '0001_initial'),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('eveonline', '0019_v5squash'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -48,4 +62,6 @@ class Migration(migrations.Migration):
|
|||||||
('srp_fleet_main', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srp.srpfleetmain')),
|
('srp_fleet_main', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srp.srpfleetmain')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
migrations.RunPython(create_permissions, reverse)
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -13,10 +13,15 @@ class SrpFleetMain(models.Model):
|
|||||||
fleet_commander = models.ForeignKey(EveCharacter, null=True, on_delete=models.SET_NULL)
|
fleet_commander = models.ForeignKey(EveCharacter, null=True, on_delete=models.SET_NULL)
|
||||||
fleet_srp_aar_link = models.CharField(max_length=254, default="")
|
fleet_srp_aar_link = models.CharField(max_length=254, default="")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (('access_srp', 'Can access SRP module'),)
|
permissions = (
|
||||||
|
('access_srp', 'Can access SRP module'),
|
||||||
|
('add_srpfleetmain', 'Can access SRP module'),
|
||||||
|
# Intentionally Commented out
|
||||||
|
# AAv0 has these in the Auth_ Content Type
|
||||||
|
# ('srp_management', 'Can Approve and Deny SRP requests, Can create an SRP Fleet'),
|
||||||
|
)
|
||||||
|
default_permissions = ()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.fleet_name
|
return self.fleet_name
|
||||||
@ -28,6 +33,8 @@ class SrpFleetMain(models.Model):
|
|||||||
@property
|
@property
|
||||||
def pending_requests(self):
|
def pending_requests(self):
|
||||||
return self.srpuserrequest_set.filter(srp_status='Pending').count()
|
return self.srpuserrequest_set.filter(srp_status='Pending').count()
|
||||||
|
|
||||||
|
|
||||||
class SrpUserRequest(models.Model):
|
class SrpUserRequest(models.Model):
|
||||||
SRP_STATUS_CHOICES = (
|
SRP_STATUS_CHOICES = (
|
||||||
('Pending', 'Pending'),
|
('Pending', 'Pending'),
|
||||||
|
@ -1,10 +1,23 @@
|
|||||||
# Generated by Django 5.1.6 on 2025-03-04 01:27
|
# Generated by Django 5.1.6 on 2025-03-04 01:27
|
||||||
|
|
||||||
import django.db.models.deletion
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
def create_permissions(apps, schema_editor) -> None:
|
||||||
|
# Remnant of AAv0
|
||||||
|
User = apps.get_model('auth', 'User')
|
||||||
|
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||||
|
Permission = apps.get_model('auth', 'Permission')
|
||||||
|
ct = ContentType.objects.get_for_model(User)
|
||||||
|
Permission.objects.get_or_create(codename="timer_management", content_type=ct, name="timer_management")
|
||||||
|
Permission.objects.get_or_create(codename="timer_view", content_type=ct, name="timer_view")
|
||||||
|
|
||||||
|
|
||||||
|
def reverse(apps, schema_editor) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
replaces = [('timerboard', '0001_initial'), ('timerboard', '0002_make_strings_more_stringy'), ('timerboard', '0003_on_delete'), ('timerboard', '0004_timer_type'), ('timerboard', '0005_alter_timer_planet_moon'), ('timerboard', '0006_alter_timer_objective_alter_timer_structure_and_more'), ('timerboard', '0007_alter_timer_structure')]
|
replaces = [('timerboard', '0001_initial'), ('timerboard', '0002_make_strings_more_stringy'), ('timerboard', '0003_on_delete'), ('timerboard', '0004_timer_type'), ('timerboard', '0005_alter_timer_planet_moon'), ('timerboard', '0006_alter_timer_objective_alter_timer_structure_and_more'), ('timerboard', '0007_alter_timer_structure')]
|
||||||
@ -12,8 +25,8 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('eveonline', '0001_initial'),
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('eveonline', '0019_v5squash'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -29,13 +42,14 @@ class Migration(migrations.Migration):
|
|||||||
('eve_time', models.DateTimeField()),
|
('eve_time', models.DateTimeField()),
|
||||||
('important', models.BooleanField(default=False)),
|
('important', models.BooleanField(default=False)),
|
||||||
('corp_timer', models.BooleanField(default=False)),
|
('corp_timer', models.BooleanField(default=False)),
|
||||||
('eve_character', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='eveonline.evecharacter')),
|
('eve_character', models.ForeignKey(null=True, on_delete=models.deletion.SET_NULL, to='eveonline.evecharacter')),
|
||||||
('eve_corp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eveonline.evecorporationinfo')),
|
('eve_corp', models.ForeignKey(on_delete=models.deletion.CASCADE, to='eveonline.evecorporationinfo')),
|
||||||
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
('user', models.ForeignKey(null=True, on_delete=models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
||||||
('timer_type', models.CharField(choices=[('UNSPECIFIED', 'Not Specified'), ('SHIELD', 'Shield'), ('ARMOR', 'Armor'), ('HULL', 'Hull'), ('FINAL', 'Final'), ('ANCHORING', 'Anchoring'), ('UNANCHORING', 'Unanchoring'), ('ABANDONED', 'Abandoned')], default='UNSPECIFIED', max_length=254)),
|
('timer_type', models.CharField(choices=[('UNSPECIFIED', 'Not Specified'), ('SHIELD', 'Shield'), ('ARMOR', 'Armor'), ('HULL', 'Hull'), ('FINAL', 'Final'), ('ANCHORING', 'Anchoring'), ('UNANCHORING', 'Unanchoring'), ('ABANDONED', 'Abandoned')], default='UNSPECIFIED', max_length=254)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ['eve_time'],
|
'ordering': ['eve_time'],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
migrations.RunPython(create_permissions, reverse)
|
||||||
]
|
]
|
||||||
|
@ -72,6 +72,12 @@ class Timer(models.Model):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['eve_time']
|
ordering = ['eve_time']
|
||||||
|
# Intentionally Commented out
|
||||||
|
# AAv0 has these in the Auth_ Content Type
|
||||||
|
# permissions = (
|
||||||
|
# ('timer_view', 'Can view Timerboard Timers'),
|
||||||
|
# ('timer_management', 'Can Manage Timerboard timers'))
|
||||||
|
# default_permissions = ()
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return str(self.system) + ' ' + str(self.details)
|
return str(self.system) + ' ' + str(self.details)
|
||||||
|
@ -40,10 +40,10 @@ To use and administer this feature, users will require some of the following.
|
|||||||
+----------------------+------------------+------------------------------------------------------------+
|
+----------------------+------------------+------------------------------------------------------------+
|
||||||
| Permission | Admin Site | Auth Site |
|
| Permission | Admin Site | Auth Site |
|
||||||
+======================+==================+============================================================+
|
+======================+==================+============================================================+
|
||||||
| auth.access_srp | None | Can create an SRP request from a fleet |
|
| srp.access_srp | None | Can create an SRP request from a fleet |
|
||||||
+----------------------+------------------+------------------------------------------------------------+
|
+----------------------+------------------+------------------------------------------------------------+
|
||||||
| auth.srp_management | None | Can Approve and Deny SRP requests, Can create an SRP Fleet |
|
| auth.srp_management | None | Can Approve and Deny SRP requests, Can create an SRP Fleet |
|
||||||
+----------------------+------------------+------------------------------------------------------------+
|
+----------------------+------------------+------------------------------------------------------------+
|
||||||
| srp.add_srpfleetmain | Can Add Model | Can Create an SRP Fleet |
|
| srp.add_srpfleetmain | None | Can Create an SRP Fleet |
|
||||||
+----------------------+------------------+------------------------------------------------------------+
|
+----------------------+------------------+------------------------------------------------------------+
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user