|
@@ -704,21 +704,17 @@ class CommunicationCreateView(MultiplePe
|
|
|
|
|
|
def get_success_url(self):
|
|
|
"""
|
|
|
Returns the URL to which the user should be redirected after a
|
|
|
communication has been created.
|
|
|
|
|
|
The URL will be set to entity details page of an entity that was
|
|
|
provided as part of the from/to GET request (in that order), or as a
|
|
|
fallback it'll direct the user to source interface's entity details
|
|
|
page.
|
|
|
The URL will either point to value provided via GET parameter "next", or
|
|
|
to project page to which the communication belongs.
|
|
|
"""
|
|
|
|
|
|
entity_id = self.request.GET.get("from_entity", None) or self.request.GET.get("to_entity", None) or self.object.source.entity.pk
|
|
|
|
|
|
return reverse("entity", args=(entity_id,))
|
|
|
return self.request.GET.get("next", reverse("project", args=(self.object.source.entity.project.pk,)))
|
|
|
|
|
|
|
|
|
class CommunicationUpdateView(MultiplePermissionsRequiredMixin, UpdateView):
|
|
|
"""
|
|
|
View for updating an existing communication.
|
|
|
"""
|
|
@@ -756,21 +752,17 @@ class CommunicationUpdateView(MultiplePe
|
|
|
|
|
|
def get_success_url(self):
|
|
|
"""
|
|
|
Returns the URL to which the user should be redirected after a
|
|
|
communication has been created.
|
|
|
|
|
|
The URL will be set to entity details page of an entity that was
|
|
|
provided as part of the from/to GET request (in that order), or as a
|
|
|
fallback it'll direct the user to source interface's entity details
|
|
|
page.
|
|
|
The URL will either point to value provided via GET parameter "next", or
|
|
|
to project page to which the communication belongs.
|
|
|
"""
|
|
|
|
|
|
entity_id = self.request.GET.get("from_entity", None) or self.request.GET.get("to_entity", None) or self.object.source.entity.pk
|
|
|
|
|
|
return reverse("entity", args=(entity_id,))
|
|
|
return self.request.GET.get("next", reverse("project", args=(self.object.source.entity.project.pk,)))
|
|
|
|
|
|
|
|
|
class CommunicationDeleteView(MultiplePermissionsRequiredMixin, DeleteView):
|
|
|
"""
|
|
|
View for deleting an communication.
|
|
|
"""
|