Skip to content

Commit

Permalink
ran migration for new model and added formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AzaniaBG committed Nov 16, 2023
1 parent ad7e59f commit c8e3204
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ class StackElementType(admin.ModelAdmin):
list_display = (
"name",
"description",
)
)
2 changes: 1 addition & 1 deletion app/core/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ class PermissionTypeViewSet(viewsets.ModelViewSet):
class StackElementTypeViewSet(viewsets.ModelViewSet):
permission_classes = [IsAuthenticated]
queryset = StackElementType.objects.all()
serializer_class = StackElementTypeSerializer
serializer_class = StackElementTypeSerializer
27 changes: 27 additions & 0 deletions app/core/migrations/0019_stackelementtype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.0.10 on 2023-11-16 15:05

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

dependencies = [
('core', '0018_rename_recurringevent_event'),
]

operations = [
migrations.CreateModel(
name='StackElementType',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')),
('name', models.CharField(max_length=255)),
('description', models.TextField(blank=True)),
],
options={
'abstract': False,
},
),
]
2 changes: 1 addition & 1 deletion app/core/migrations/max_migration.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0018_rename_recurringevent_event
0019_stackelementtype
2 changes: 1 addition & 1 deletion app/core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ def permission_type2():

@pytest.fixture
def stack_element_type():
return StackElementType.objects.create(name="Test Stack Element Type")
return StackElementType.objects.create(name="Test Stack Element Type")
2 changes: 1 addition & 1 deletion app/core/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,4 @@ def test_create_stack_element_type(auth_client):
}
res = auth_client.post(STACK_ELEMENT_TYPE_URL, payload)
assert res.status_code == status.HTTP_201_CREATED
assert res.data["name"] == payload["name"]
assert res.data["name"] == payload["name"]
2 changes: 1 addition & 1 deletion app/core/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def test_permission_type2(permission_type2):


def test_stack_element_type(stack_element_type):
assert str(stack_element_type) == "Test Stack Element Type"
assert str(stack_element_type) == "Test Stack Element Type"

0 comments on commit c8e3204

Please sign in to comment.