-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #681 from UW-GAC/deploy/stage
Deploy ubuntu 22.04 upgrade to prod
- Loading branch information
Showing
25 changed files
with
329 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ on: | |
|
||
jobs: | ||
update-requirements-files: | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -16,10 +14,10 @@ jobs: | |
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Set up Python 3.8 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
|
||
- name: Update requirements files | ||
uses: UW-GAC/pip-tools-actions/[email protected] | ||
|
2 changes: 1 addition & 1 deletion
2
...phenotype_inventory_input_example_data.py → add_inventory_input_example_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,8 @@ | |
{# Placed at the top of the document so pages load faster with defer #} | ||
{% block javascript %} | ||
<!-- Bootstrap JS and its dependencies--> | ||
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | ||
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> | ||
<script src="https://unpkg.com/[email protected]" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script> | ||
|
||
<!-- Your stuff: Third-party javascript libraries go here --> | ||
|
@@ -119,9 +119,10 @@ | |
{% endif %} | ||
|
||
{% if request.user.is_authenticated and not request.user.account %} | ||
<div class="alert alert-warning" role="alert"> | ||
<div class="alert alert-warning alert-dismissible fade show" role="alert"> | ||
<i class="bi bi-exclamation-triangle-fill me-1"></i> | ||
You must <a href="{% url 'anvil_consortium_manager:accounts:link' %}">link your AnVIL account</a> before you can access any data on AnVIL. | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> | ||
</div> | ||
{% endif %} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -574,6 +574,39 @@ def test_acm_staff_view(self): | |
self.assertIn(agreement_1.signed_agreement, response.context["signed_agreements"]) | ||
self.assertIn(agreement_2.signed_agreement, response.context["signed_agreements"]) | ||
|
||
def test_inactive_user_inactive_message(self): | ||
"""Inactive user alert is shown for an inactive user.""" | ||
user = UserFactory.create(is_active=False) | ||
self.client.force_login(self.user) | ||
response = self.client.get(user.get_absolute_url()) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertContains(response, "This user is inactive.") | ||
|
||
def test_active_user_no_inactive_message(self): | ||
"""Inactive user alert is not shown for an active user.""" | ||
self.client.force_login(self.user) | ||
response = self.client.get(self.user.get_absolute_url()) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertNotContains(response, "This user is inactive.") | ||
|
||
def test_inactive_anvil_account_alert_is_inactive(self): | ||
"""Alert is shown when AnVIL account is inactive.""" | ||
account = AccountFactory.create(email="[email protected]", user=self.user, verified=True) | ||
account.status = account.INACTIVE_STATUS | ||
account.save() | ||
self.client.force_login(self.user) | ||
response = self.client.get(self.user.get_absolute_url()) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertContains(response, "This account is inactive.") | ||
|
||
def test_inactive_anvil_account_alert_is_active(self): | ||
"""Alert is not shown when AnVIL account is active.""" | ||
AccountFactory.create(email="[email protected]", user=self.user, verified=True) | ||
self.client.force_login(self.user) | ||
response = self.client.get(self.user.get_absolute_url()) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertNotContains(response, "This account is inactive.") | ||
|
||
|
||
class UserAutocompleteTest(TestCase): | ||
def setUp(self): | ||
|
@@ -723,6 +756,17 @@ def test_get_selected_result_label(self): | |
view.setup(request) | ||
self.assertEqual(view.get_selected_result_label(instance), "First Last ([email protected])") | ||
|
||
def test_excludes_inactive_users(self): | ||
"""Queryset excludes excludes inactive users.""" | ||
UserFactory.create(is_active=False) | ||
request = self.factory.get(self.get_url()) | ||
request.user = self.user | ||
response = self.get_view()(request) | ||
returned_ids = [int(x["id"]) for x in json.loads(response.content.decode("utf-8"))["results"]] | ||
# Only test user. | ||
self.assertEqual(len(returned_ids), 1) | ||
self.assertEqual(returned_ids, [self.user.pk]) | ||
|
||
|
||
class UserLookup(TestCase): | ||
"""Test for UserLookup view""" | ||
|
@@ -799,3 +843,21 @@ def test_blank_user(self): | |
self.assertIn("user", form.errors.keys()) | ||
self.assertEqual(len(form.errors["user"]), 1) | ||
self.assertIn("required", form.errors["user"][0]) | ||
|
||
def test_invalid_inactive_user(self): | ||
"""Form is invalid with an inactive user.""" | ||
object = UserFactory.create( | ||
username="user1", | ||
password="passwd", | ||
email="[email protected]", | ||
is_active=False, | ||
) | ||
self.client.force_login(self.user) | ||
response = self.client.post(self.get_url(), {"user": object.pk}) | ||
self.assertEqual(response.status_code, 200) | ||
form = response.context_data["form"] | ||
self.assertFalse(form.is_valid()) | ||
self.assertEqual(len(form.errors), 1) | ||
self.assertIn("user", form.errors) | ||
self.assertEqual(len(form.errors["user"]), 1) | ||
self.assertIn("valid choice", form.errors["user"][0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.