From 56e9eb9d8d34346e9f706e2b2146aa9dbf567e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Thu, 2 Nov 2023 14:14:52 +0100 Subject: [PATCH] hub: remove a separate model for a single permission The `errata_xmlrpc_scan` user permission was moved to the more appropriate `Scan` model. --- .../migrations/0017_auto_20231102_1414.py | 20 +++++++++++++++++++ osh/hub/scan/models.py | 14 +++---------- 2 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 osh/hub/scan/migrations/0017_auto_20231102_1414.py diff --git a/osh/hub/scan/migrations/0017_auto_20231102_1414.py b/osh/hub/scan/migrations/0017_auto_20231102_1414.py new file mode 100644 index 00000000..753cc749 --- /dev/null +++ b/osh/hub/scan/migrations/0017_auto_20231102_1414.py @@ -0,0 +1,20 @@ +# Generated by Django 3.2.20 on 2023-11-02 14:14 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('scan', '0016_recompute_subtask_count'), + ] + + operations = [ + migrations.DeleteModel( + name='Permissions', + ), + migrations.AlterModelOptions( + name='scan', + options={'get_latest_by': 'date_submitted', 'permissions': [('errata_xmlrpc_scan', 'Can submit ET scan via XML-RPC')]}, + ), + ] diff --git a/osh/hub/scan/models.py b/osh/hub/scan/models.py index dd2b6c28..9d293ead 100644 --- a/osh/hub/scan/models.py +++ b/osh/hub/scan/models.py @@ -105,17 +105,6 @@ ) -class Permissions(models.Model): - """ - Custom permissions - """ - class Meta: - permissions = ( - ('errata_xmlrpc_scan', - 'Can submit ET scan via XML-RPC'), - ) - - class MockConfigMixin: def verify_by_name(self, name): try: @@ -584,6 +573,9 @@ class Scan(models.Model): class Meta: get_latest_by = "date_submitted" + permissions = [ + ('errata_xmlrpc_scan', 'Can submit ET scan via XML-RPC'), + ] def __str__(self): prefix = "#%s %s %s" % (self.id,