Skip to content

Commit

Permalink
object.pk
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon committed May 9, 2023
1 parent 7ba14f8 commit 4ca410b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions landingzones/templates/landingzones/landingzone_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
{% load crispy_forms_filters %}

{% block title %}
{% if action == 'create' %}Create Landing Zone in {{ project.title }}
{% if not object.pk %}Create Landing Zone in {{ project.title }}
{% else %}Update Landing Zone {% if request.user.username == zone.user.username %}{{ zone.title }}{% else %}{{ zone.user.username }} / {{ zone.title }}{% endif %}
{% endif %}
{% endblock title %}

{% block projectroles_extend %}

<div class="container-fluid sodar-subtitle-container">
<h3>{% if action == 'create' %}Create Landing Zone in {{ project.title }}
<h3>{% if not object.pk %}Create Landing Zone in {{ project.title }}
{% else %}Update Landing Zone {% if request.user.username == zone.user.username %}{{ zone.title }}{% else %}{{ zone.user.username }} / {{ zone.title }}{% endif %}
{% endif %}</h3>
</div>
Expand Down
7 changes: 0 additions & 7 deletions landingzones/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,6 @@ class ZoneCreateView(
form_class = LandingZoneForm
permission_required = 'landingzones.create_zone'

def get_context_data(self, *args, **kwargs):
"""Add action to context"""
context = super().get_context_data(*args, **kwargs)
context['action'] = 'create'
return context

def get_form_kwargs(self):
"""Pass project to form"""
kwargs = super().get_form_kwargs()
Expand Down Expand Up @@ -544,7 +538,6 @@ def get_context_data(self, *args, **kwargs):
context['zone'] = LandingZone.objects.get(
sodar_uuid=self.kwargs['landingzone']
)
context['action'] = 'update'
return context

def get_permission_required(self, user):
Expand Down

0 comments on commit 4ca410b

Please sign in to comment.