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

Bug/VOGRE-45 #49

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h5 class="list-group-item-heading mb-0">Group Texts</h5>
<path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z"/>
</svg>{% else %}{% endif %}</td>
<td>
<a href="{% if project_id %}{% url 'repository_text_import' repository.id group_id text.key project_id %}{% else %}{% url 'repository_text_import' repository.id group_id text.key %}{% endif %}" class="btn btn-primary btn-sm">Import</a>
<a href="{% if project_id %}{% url 'repository_text_import' repository.id group_id text.key project_id %}{% else %}{% url 'repository_project_list' repository.id group_id text.key %}{% endif %}" class="btn btn-primary btn-sm">Import</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at this more closely, just put the redirect url here directly instead of having the if statement in the view method.

</td>
</tr>
{% empty %}
Expand Down
1 change: 1 addition & 0 deletions vogon/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
re_path(r'^repository/(?P<repository_id>[0-9]+)/search/$', views.repository_views.repository_search, name='repository_search'),
re_path(r'^repository/(?P<repository_id>[0-9]+)/collections/(?P<group_id>[0-9]+)/$', views.repository_views.repository_collection, name='repository_collection'),
re_path(r'^repository/(?P<repository_id>[0-9]+)/collection/(?P<group_id>[0-9]+)/group-collection/(?P<group_collection_id>[a-zA-Z0-9]+)/texts/$', views.repository_views.repository_collection_texts, name='repository_collections_text_list'),
re_path(r'^repository/(?P<repository_id>[0-9]+)/group/(?P<group_id>[a-zA-Z0-9]+)/text/(?P<text_key>[a-zA-Z0-9]+)/project/$', views.repository_views.repository_text_import, name='repository_project_list'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then we don't need this

re_path(r'^repository/(?P<repository_id>[0-9]+)/group/(?P<group_id>[a-zA-Z0-9]+)/text/(?P<text_key>[a-zA-Z0-9]+)/project/(?P<project_id>[0-9]+)?/$', views.repository_views.repository_text_import, name='repository_text_import'),
re_path(r'^repository/(?P<repository_id>[0-9]+)/text/(?P<text_id>[0-9]+)/content/(?P<content_id>[0-9]+)/$', views.repository_views.repository_text_content, name='repository_text_content'),
re_path(r'^repository/(?P<repository_id>[0-9]+)/$', views.repository_views.repository_details, name='repository_details'),
Expand Down