Skip to content

Commit

Permalink
hub: remove a separate model for a single permission
Browse files Browse the repository at this point in the history
The `errata_xmlrpc_scan` user permission was moved to the more
appropriate `Scan` model.
  • Loading branch information
lzaoral committed Nov 7, 2023
1 parent 668c44c commit 56e9eb9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
20 changes: 20 additions & 0 deletions osh/hub/scan/migrations/0017_auto_20231102_1414.py
Original file line number Diff line number Diff line change
@@ -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')]},
),
]
14 changes: 3 additions & 11 deletions osh/hub/scan/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 56e9eb9

Please sign in to comment.