Skip to content

Commit

Permalink
Merge pull request #198 from jamescurtin/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
iragm authored Sep 2, 2024
2 parents 553442e + f04d648 commit 96571c2
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
DEBUG: True
SECRET_KEY: abcde
ALLOWED_HOST_1: localhost
ALLOWED_HOST_2:
ALLOWED_HOST_2:
ALLOWED_HOST_3: 127.0.0.1
DATABASE_ENGINE: django.db.backends.mysql
DATABASE_NAME: auctions
Expand All @@ -21,7 +21,7 @@ env:
BASE_URL: https://auction.fish
EMAIL_USE_TLS: True
EMAIL_HOST: smtp.example.com
EMAIL_PORT:
EMAIL_PORT:
EMAIL_HOST_USER: [email protected]
EMAIL_HOST_PASSWORD: 123456
DEFAULT_FROM_EMAIL: Notifications
Expand All @@ -46,7 +46,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
python-version: [3.11]

steps:
- uses: actions/checkout@v4
Expand Down
19 changes: 19 additions & 0 deletions auctions/static/admin/css/unusable_password_field.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Hide warnings fields if usable password is selected */
form:has(#id_usable_password input[value="true"]:checked) .messagelist {
display: none;
}

/* Hide password fields if unusable password is selected */
form:has(#id_usable_password input[value="false"]:checked) .field-password1,
form:has(#id_usable_password input[value="false"]:checked) .field-password2 {
display: none;
}

/* Select appropriate submit button */
form:has(#id_usable_password input[value="true"]:checked) input[type="submit"].unset-password {
display: none;
}

form:has(#id_usable_password input[value="false"]:checked) input[type="submit"].set-password {
display: none;
}
29 changes: 29 additions & 0 deletions auctions/static/admin/js/unusable_password_field.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"use strict";
// Fallback JS for browsers which do not support :has selector used in
// admin/css/unusable_password_fields.css
// Remove file once all supported browsers support :has selector
try {
// If browser does not support :has selector this will raise an error
document.querySelector("form:has(input)");
} catch (error) {
console.log("Defaulting to javascript for usable password form management: " + error);
// JS replacement for unsupported :has selector
document.querySelectorAll('input[name="usable_password"]').forEach(option => {
option.addEventListener('change', function() {
const usablePassword = (this.value === "true" ? this.checked : !this.checked);
const submit1 = document.querySelector('input[type="submit"].set-password');
const submit2 = document.querySelector('input[type="submit"].unset-password');
const messages = document.querySelector('#id_unusable_warning');
document.getElementById('id_password1').closest('.form-row').hidden = !usablePassword;
document.getElementById('id_password2').closest('.form-row').hidden = !usablePassword;
if (messages) {
messages.hidden = usablePassword;
}
if (submit1 && submit2) {
submit1.hidden = !usablePassword;
submit2.hidden = usablePassword;
}
});
option.dispatchEvent(new Event('change'));
});
}
1 change: 1 addition & 0 deletions fishauctions/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
#'lot_full': {'size': (600, 600), 'crop': False},
},
}
THUMBNAIL_DEFAULT_STORAGE_ALIAS = "default"

SECURE_REFERRER_POLICY= "strict-origin-when-cross-origin"

Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ django_htmx
django_debug_toolbar
django-recaptcha
django-chartjs
easy-thumbnails
easy-thumbnails>2.8.5
hyperlink
idna
incremental
Expand Down Expand Up @@ -71,4 +71,4 @@ ua-parser
user-agents
heif-image-plugin
gunicorn
django-ses[events]
django-ses[events]
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bleach[css]==6.1.0
# django-post-office
boto3==1.35.0
# via django-ses
botocore>=1.35.0
botocore==1.35.10
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -83,7 +83,7 @@ defusedxml==0.7.1
# via
# -r ./requirements.in
# python3-openid
django>=4.2.14,<5.1
django==5.1
# via
# -r ./requirements.in
# channels
Expand Down Expand Up @@ -135,15 +135,15 @@ django-markdownfield==0.11.0
# via -r ./requirements.in
django-post-office==3.9.0
# via -r ./requirements.in
django-qr-code>=4.0.1
django-qr-code==4.1.0
# via -r ./requirements.in
django-recaptcha==4.0.0
# via -r ./requirements.in
django-ses[events]==4.1.0
# via -r ./requirements.in
django-tables2==2.7.0
# via -r ./requirements.in
easy-thumbnails==2.8.5
easy-thumbnails==2.9
# via -r ./requirements.in
gunicorn==22.0.0
# via -r ./requirements.in
Expand Down Expand Up @@ -304,7 +304,7 @@ ua-parser==0.18.0
# via
# -r ./requirements.in
# user-agents
urllib3>=1.21.1
urllib3==2.2.2
# via
# -r ./requirements.in
# botocore
Expand Down

0 comments on commit 96571c2

Please sign in to comment.