diff --git a/apis_core/apis_entities/models.py b/apis_core/apis_entities/models.py index 1768d8faa..b88d1303b 100644 --- a/apis_core/apis_entities/models.py +++ b/apis_core/apis_entities/models.py @@ -50,17 +50,6 @@ def get_or_create_uri(cls, uri): def get_entity_list_filter(cls): return None - def get_edit_url(self): - """ - We override the edit url, because entities have a - custom view that includes the relations - """ - ct = ContentType.objects.get_for_model(self) - return reverse( - "apis_core:apis_entities:generic_entities_edit_view", - args=[ct.model, self.id], - ) - @functools.cached_property def get_prev_id(self): if NEXT_PREV: diff --git a/apis_core/apis_entities/templates/apis_core/apis_entities/abstractentity_form.html b/apis_core/apis_entities/templates/apis_core/apis_entities/abstractentity_form.html index fb564fda5..19b9f3c57 100644 --- a/apis_core/apis_entities/templates/apis_core/apis_entities/abstractentity_form.html +++ b/apis_core/apis_entities/templates/apis_core/apis_entities/abstractentity_form.html @@ -16,6 +16,7 @@
+ {% mergeform as mergeform %} {% if mergeform %} {% crispy mergeform mergeform.helper %} {% endif %} diff --git a/apis_core/apis_entities/urls.py b/apis_core/apis_entities/urls.py index b1d21ad38..f93b0f67c 100644 --- a/apis_core/apis_entities/urls.py +++ b/apis_core/apis_entities/urls.py @@ -9,7 +9,6 @@ EntitiesAutocomplete, EntitiesDuplicate, EntitiesMerge, - EntitiesUpdate, ) from apis_core.generic.views import Create, Delete, Detail, List @@ -62,11 +61,6 @@ def to_url(self, value): Detail.as_view(), name="generic_entities_detail_view", ), - path( - "/edit/", - EntitiesUpdate.as_view(), - name="generic_entities_edit_view", - ), path( "/delete/", Delete.as_view(), diff --git a/apis_core/apis_entities/views.py b/apis_core/apis_entities/views.py index e6c341af3..e33821868 100644 --- a/apis_core/apis_entities/views.py +++ b/apis_core/apis_entities/views.py @@ -11,14 +11,7 @@ from apis_core.apis_entities.forms import EntitiesMergeForm from apis_core.apis_metainfo.models import RootObject from apis_core.generic.helpers import generate_search_filter -from apis_core.generic.views import GenericModelMixin, Update - - -class EntitiesUpdate(Update): - def get_context_data(self, *args, **kwargs): - context = super().get_context_data(*args, **kwargs) - context["mergeform"] = EntitiesMergeForm(instance=self.get_object()) - return context +from apis_core.generic.views import GenericModelMixin class EntitiesDuplicate(GenericModelMixin, PermissionRequiredMixin, View):