Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2038] Remove appointment model #982

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/open_inwoner/accounts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from open_inwoner.utils.mixins import UUIDAdminFirstInOrder

from .choices import ContactTypeChoices
from .models import Action, Appointment, Document, Invite, Message, User
from .models import Action, Document, Invite, Message, User


class ReadOnlyFileMixin:
Expand Down Expand Up @@ -235,13 +235,6 @@ def has_change_permission(self, request, obj=None):
return False


@admin.register(Appointment)
class AppointmentAdmin(UUIDAdminFirstInOrder, admin.ModelAdmin):
readonly_fields = ("uuid",)
list_display = ("name", "datetime", "created_on", "created_by")
list_filter = ("created_by",)


@admin.register(Message)
class MessageAdmin(ReadOnlyFileMixin, PrivateMediaMixin, admin.ModelAdmin):
list_display = ("sender", "receiver", "created_on", "seen", "sent")
Expand Down
16 changes: 16 additions & 0 deletions src/open_inwoner/accounts/migrations/0071_delete_appointment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 3.2.23 on 2024-01-23 08:56

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("accounts", "0070_auto_20231205_1657"),
]

operations = [
migrations.DeleteModel(
name="Appointment",
),
]
43 changes: 0 additions & 43 deletions src/open_inwoner/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,49 +535,6 @@ def __str__(self):
return self.name


class Appointment(models.Model):
uuid = models.UUIDField(
verbose_name=_("UUID"),
unique=True,
default=uuid4,
help_text=_("Used as a reference in the appointments api."),
)
name = models.CharField(
verbose_name=_("Name"),
default="",
max_length=250,
help_text=_("The name of the appointment."),
)
datetime = models.DateTimeField(
verbose_name=_("Appointment time"),
help_text=_("This is the time that the appointment is at."),
)
created_on = models.DateTimeField(
verbose_name=_("Created on"),
auto_now_add=True,
help_text=_("This is the date the appointment was created"),
)
updated_on = models.DateTimeField(
verbose_name=_("Updated on"),
auto_now=True,
help_text=_("This is the date when the appointment was last changed"),
)
created_by = models.ForeignKey(
"accounts.User",
verbose_name=_("Created by"),
on_delete=models.CASCADE,
related_name="appointments",
help_text=_("The person that created the appointment."),
)

class Meta:
verbose_name = _("Appointment")
verbose_name_plural = _("Appointments")

def __str__(self):
return self.name


class Action(models.Model):
uuid = models.UUIDField(
verbose_name=_("UUID"),
Expand Down
9 changes: 0 additions & 9 deletions src/open_inwoner/accounts/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ class Meta:
user_id = factory.LazyAttribute(lambda o: o.created_for.id)


class AppointmentFactory(factory.django.DjangoModelFactory):
class Meta:
model = "accounts.Appointment"

name = factory.Faker("first_name")
datetime = factory.fuzzy.FuzzyDateTime(datetime.now(timezone.utc))
created_by = factory.SubFactory(UserFactory)


class ActionFactory(factory.django.DjangoModelFactory):
class Meta:
model = "accounts.Action"
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/conf/fixtures/auth-groups.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/open_inwoner/conf/fixtures/django-admin-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
"accounts",
"action"
],
[
"accounts",
"appointment"
],
[
"accounts",
"document"
Expand Down
Binary file modified src/open_inwoner/conf/locale/nl/LC_MESSAGES/django.mo
Binary file not shown.
Loading
Loading