-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds a LicenseTransferJob model and admin
Also installs django-autocomplete-light for help to support advanced admin autocomplete field filtering, and therefore runs make upgrade to pull in some other new package versions.
- Loading branch information
1 parent
9335ec3
commit 7afdfc0
Showing
18 changed files
with
487 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
license_manager/apps/subscriptions/migrations/0062_add_license_transfer_job.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Generated by Django 4.2.6 on 2023-10-18 20:13 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import model_utils.fields | ||
import simple_history.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('subscriptions', '0061_auto_20230927_1119'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='LicenseTransferJob', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), | ||
('completed_at', models.DateTimeField(blank=True, help_text='The time at which the job was successfully processed.', null=True)), | ||
('notes', models.TextField(blank=True, help_text='Say something about why the licenses are being transferred.', null=True)), | ||
('is_dry_run', models.BooleanField(default=False)), | ||
('delimtter', models.CharField(choices=[('\n', 'Newline (\n)'), (',', 'Comma (,)'), ('|', 'Pipe (|)')], default='\n', max_length=8)), | ||
('license_uuids_raw', models.TextField(help_text='Delimitted list of license_uuids to transfer')), | ||
('dry_run_results', models.TextField(editable=False, help_text='Raw results of what licenses would have changed if this was not a dry run', null=True)), | ||
('customer_agreement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='license_transfer_jobs', to='subscriptions.customeragreement')), | ||
('new_subscription_plan', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='license_transfer_jobs_new', to='subscriptions.subscriptionplan')), | ||
('old_subscription_plan', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='license_transfer_jobs_old', to='subscriptions.subscriptionplan')), | ||
], | ||
options={ | ||
'verbose_name': 'License Transfer Job', | ||
'verbose_name_plural': 'License Transfer Jobs', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalLicenseTransferJob', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), | ||
('completed_at', models.DateTimeField(blank=True, help_text='The time at which the job was successfully processed.', null=True)), | ||
('notes', models.TextField(blank=True, help_text='Say something about why the licenses are being transferred.', null=True)), | ||
('is_dry_run', models.BooleanField(default=False)), | ||
('delimtter', models.CharField(choices=[('\n', 'Newline (\n)'), (',', 'Comma (,)'), ('|', 'Pipe (|)')], default='\n', max_length=8)), | ||
('license_uuids_raw', models.TextField(help_text='Delimitted list of license_uuids to transfer')), | ||
('dry_run_results', models.TextField(editable=False, help_text='Raw results of what licenses would have changed if this was not a dry run', null=True)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField()), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('customer_agreement', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscriptions.customeragreement')), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('new_subscription_plan', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscriptions.subscriptionplan')), | ||
('old_subscription_plan', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscriptions.subscriptionplan')), | ||
], | ||
options={ | ||
'verbose_name': 'historical License Transfer Job', | ||
'verbose_name_plural': 'historical License Transfer Jobs', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.