Skip to content

Commit a511ef1

Browse files
committed
Fix: flake8 line length and registered model in admin
1 parent e1d2a55 commit a511ef1

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

app/core/admin.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .models import PracticeArea
1919
from .models import ProgramArea
2020
from .models import Project
21+
from .models import ProjectStackElementXref
2122
from .models import ProjectStatus
2223
from .models import ProjectUrl
2324
from .models import Referrer
@@ -28,6 +29,7 @@
2829
from .models import SocMinor
2930
from .models import StackElement
3031
from .models import StackElementType
32+
from .models import UrlStatusType
3133
from .models import UrlType
3234
from .models import User
3335
from .models import UserStatusType
@@ -311,3 +313,16 @@ class ProjectUrlAdmin(admin.ModelAdmin):
311313
"external_id",
312314
"url",
313315
)
316+
317+
318+
@admin.register(ProjectStackElementXref)
319+
class ProjectStackElementXrefAdmin(admin.ModelAdmin):
320+
list_display = (
321+
"project",
322+
"stack_element",
323+
)
324+
325+
326+
@admin.register(UrlStatusType)
327+
class UrlStatusTypeAdmin(admin.ModelAdmin):
328+
list_display = ("name", "description")

app/core/api/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,10 @@ def destroy(self, request, *args, **kwargs):
553553
except ProtectedError as e:
554554
return Response(
555555
{
556-
"detail": "Cannot delete UrlStatusType because it is referenced by one or more ProjectUrl records.",
556+
"detail": (
557+
"Cannot delete UrlStatusType because it is referenced by one or "
558+
"more ProjectUrl records."
559+
),
557560
"protected": [str(obj.uuid) for obj in e.protected_objects],
558561
},
559562
status=status.HTTP_400_BAD_REQUEST,

0 commit comments

Comments
 (0)