Skip to content

Commit

Permalink
Merge branch 'release/0.3.27' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Mar 12, 2024
2 parents 021f179 + 3838f73 commit 0179db9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
sudo apt-get -y update
sudo apt-get install libcups2-dev wamerican
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -48,7 +48,7 @@ jobs:
echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- "-x *test*.py"

- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
language_version: python3.11
Expand Down Expand Up @@ -42,7 +42,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
rev: v1.34.0
hooks:
- id: yamllint
args:
Expand Down
4 changes: 2 additions & 2 deletions edc_navbar/navbar_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ def real_url_name(self) -> str:
url_name = self.url_name.split(":")[1] if self.no_url_namespace else self.url_name
return url_name

def set_disabled(self, user: User = None):
if user.has_perm(self.codename):
def set_disabled(self, user: User | None = None):
if user and user.has_perm(self.codename):
self.disabled = ""
2 changes: 1 addition & 1 deletion edc_navbar/templatetags/edc_navbar_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def render_navbar(context) -> dict:
def render_navbar_item(context, navbar_item: NavbarItem) -> dict:
data = {}
url = navbar_item.get_url()
navbar_item.set_disabled(user=context["request"].user)
navbar_item.set_disabled(user=getattr(context["request"], "user", None))
if url:
data.update(url=url)
data.update(navbar_item=navbar_item)
Expand Down

0 comments on commit 0179db9

Please sign in to comment.