Skip to content

Disable Transfer to Orgs with Inactive subscription Bug Fix #18094

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
22 changes: 13 additions & 9 deletions warehouse/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1541,8 +1541,8 @@ msgstr ""
#: warehouse/templates/manage/account/totp-provision.html:69
#: warehouse/templates/manage/account/webauthn-provision.html:44
#: warehouse/templates/manage/organization/activate_subscription.html:34
#: warehouse/templates/manage/organization/projects.html:128
#: warehouse/templates/manage/organization/projects.html:151
#: warehouse/templates/manage/organization/projects.html:129
#: warehouse/templates/manage/organization/projects.html:160
#: warehouse/templates/manage/organization/roles.html:270
#: warehouse/templates/manage/organization/roles.html:291
#: warehouse/templates/manage/organization/settings.html:50
Expand Down Expand Up @@ -5617,37 +5617,41 @@ msgid ""
"project to the organization."
msgstr ""

#: warehouse/templates/manage/organization/projects.html:127
#: warehouse/templates/manage/organization/projects.html:128
msgid "️Name of existing project"
msgstr ""

#: warehouse/templates/manage/organization/projects.html:134
#: warehouse/templates/manage/organization/projects.html:135
msgid "You do not own any projects that you can add to this organization."
msgstr ""

#: warehouse/templates/manage/organization/projects.html:141
#: warehouse/templates/manage/organization/projects.html:142
msgid ""
"Owners or managers of this organization can transfer a project that they "
"own to this organization if the project has not been added to another "
"organization. A project that has been added to another organization can "
"be transferred from the project settings page."
msgstr ""

#: warehouse/templates/manage/organization/projects.html:146
#: warehouse/templates/manage/organization/projects.html:147
msgid "Transfer existing project"
msgstr ""

#: warehouse/templates/manage/organization/projects.html:150
#: warehouse/templates/manage/organization/projects.html:151
msgid "The Organization does not have any active subscription."
msgstr ""

#: warehouse/templates/manage/organization/projects.html:159
msgid "️Name of new project"
msgstr ""

#: warehouse/templates/manage/organization/projects.html:161
#: warehouse/templates/manage/organization/projects.html:170
msgid ""
"Owners of this organization can create an empty project and add it to the"
" organization."
msgstr ""

#: warehouse/templates/manage/organization/projects.html:166
#: warehouse/templates/manage/organization/projects.html:175
msgid "Create and add new project"
msgstr ""

Expand Down
15 changes: 12 additions & 3 deletions warehouse/templates/manage/organization/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ <h2 class="sub-title">{% trans %}Add project to organization{% endtrans %}</h2>
{% trans %}️New or existing project?{% endtrans %}
</label>
{% for subfield in add_organization_project_form.add_existing_project %}
{{ subfield(data_target=".radio-toggle-" + loop.index|string) }}
{{ subfield.label }}
{% endfor %}
{%set is_existing = subfield.data == 'true' %} {% set should_disable =
is_existing and not organization.active_subscription %} {{ subfield(data_target=".radio-toggle-" + loop.index|string,
disabled=should_disable) }} {{ subfield.label }} {% endfor %}
<div id="add-existing-project-errors">
{{ field_errors(add_organization_project_form.add_existing_project) }}
</div>
Expand All @@ -122,6 +122,7 @@ <h2 class="sub-title">{% trans %}Add project to organization{% endtrans %}</h2>
</p>
<p class="form-group__text"></p>
{# end radio buttons #}
{% if organization.active_subscription %}
<div class="form-group radio-toggle radio-toggle-1">
<label class="form-group__label" for="project">
{% trans %}️Name of existing project{% endtrans %}
Expand All @@ -144,6 +145,14 @@ <h2 class="sub-title">{% trans %}Add project to organization{% endtrans %}</h2>
</p>
</div>
<input value="{% trans %}Transfer existing project{% endtrans %}" class="button button--primary radio-toggle radio-toggle-1" type="submit">
{% else %}
<div class="form-group radio-toggle radio-toggle-1">
<div class="form-errors" role="alert">
{% trans %}The Organization does not have any active
subscription.{%endtrans %}
</div>
</div>
{% endif %}

<div class="form-group radio-toggle radio-toggle-2">
<label class="form-group__label" for="project">
Expand Down