Skip to content

Commit

Permalink
chore(api): remove name from model
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schultz committed Aug 3, 2023
1 parent 2a01a0b commit 8e0be76
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
6 changes: 1 addition & 5 deletions api/passport_admin/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def get_address(did: str):


class Banner(Schema):
name: str
content: str
link: str
banner_id: int
Expand All @@ -42,10 +41,7 @@ def get_banners(request):
.all()
)

return [
Banner(name=b.name, content=b.content, link=b.link, banner_id=b.pk)
for b in banners
]
return [Banner(content=b.content, link=b.link, banner_id=b.pk) for b in banners]
except:
return {
"status": "failed",
Expand Down
17 changes: 17 additions & 0 deletions api/passport_admin/migrations/0003_remove_passportbanner_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.3 on 2023-08-03 16:00

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("passport_admin", "0002_rename_description_passportbanner_content_and_more"),
]

operations = [
migrations.RemoveField(
model_name="passportbanner",
name="name",
),
]
1 change: 0 additions & 1 deletion api/passport_admin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class PassportBanner(models.Model):
Model representing a Passport Banner.
"""

name = models.CharField(max_length=255)
content = models.TextField()
link = models.URLField(blank=True, null=True)
is_active = models.BooleanField(default=True)
Expand Down
7 changes: 0 additions & 7 deletions api/passport_admin/tests/test_passport_admin.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import copy
import json
from collections import namedtuple

import pytest
from account.models import Nonce
from ceramic_cache.api import DbCacheToken
from django.test import Client
from ninja_jwt.tokens import AccessToken
from passport_admin.api import get_address
from passport_admin.models import DismissedBanners, PassportBanner

Expand Down

0 comments on commit 8e0be76

Please sign in to comment.