mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-24 05:31:57 +00:00
Compare commits
2 Commits
2025.5.20.
...
2025.6.3
| Author | SHA1 | Date | |
|---|---|---|---|
| c5bd3d138e | |||
| d5f63f4387 |
29
.github/dependabot.yml
vendored
Normal file
29
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "uv"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
time: "04:00"
|
||||
open-pull-requests-limit: 8
|
||||
allow:
|
||||
- dependency-type: "all"
|
||||
reviewers:
|
||||
- "Cian-H"
|
||||
assignees:
|
||||
- "Cian-H"
|
||||
commit-message:
|
||||
prefix: "uv-deps"
|
||||
prefix-development: "uv-deps-dev"
|
||||
include: "scope"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
time: "04:00"
|
||||
open-pull-requests-limit: 5
|
||||
commit-message:
|
||||
prefix: "ci"
|
||||
@@ -8,4 +8,4 @@
|
||||
|
||||
"""Metadata for this python module."""
|
||||
|
||||
__version__ = "2025.5.20.8"
|
||||
__version__ = "2025.6.3"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
"""invenio module for I-Form theme."""
|
||||
|
||||
from flask import g, has_request_context
|
||||
from flask_login import login_required
|
||||
from invenio_records_marc21.ui.theme import current_identity_can_view
|
||||
|
||||
@@ -34,7 +35,16 @@ class InvenioThemeIform(object):
|
||||
|
||||
@app.context_processor
|
||||
def inject_visibility():
|
||||
return {"can_view_marc21": current_identity_can_view()}
|
||||
def can_view_marc21():
|
||||
try:
|
||||
# Only check if we're in a request context and identity exists
|
||||
if has_request_context() and hasattr(g, "identity") and g.identity:
|
||||
return current_identity_can_view()
|
||||
return False
|
||||
except (AttributeError, RuntimeError):
|
||||
return False
|
||||
|
||||
return {"can_view_marc21": can_view_marc21()}
|
||||
|
||||
app.extensions["invenio-theme-iform"] = self
|
||||
|
||||
|
||||
Reference in New Issue
Block a user