- Backport patches to fix issues after 5.14.1 release (https://pagure.io/pagure/pull-request/5486)
- fix(5.14.x): Use '==' instead of 'is' in template if condition because to work with old Jinja2 versions - fix(oidc): Edge case, avoid 'KeyError' after pagure update if a cached session is used OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/pagure?expand=0&rev=61
This commit is contained in:
parent
5c9479d4c8
commit
d36328043e
44
5486.patch
Normal file
44
5486.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From 7abc9608afe37e28221d12afb5c2078518febf9f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dominik Wombacher <dominik@wombacher.cc>
|
||||||
|
Date: May 27 2024 18:52:55 +0000
|
||||||
|
Subject: [PATCH 1/2] fix(oidc): Edge case, avoid 'KeyError' after pagure update if a cached session is used
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
diff --git a/pagure/ui/oidc_login.py b/pagure/ui/oidc_login.py
|
||||||
|
index 2495387..225646b 100644
|
||||||
|
--- a/pagure/ui/oidc_login.py
|
||||||
|
+++ b/pagure/ui/oidc_login.py
|
||||||
|
@@ -34,6 +34,8 @@ _log = logging.getLogger(__name__)
|
||||||
|
def fas_user_from_oidc():
|
||||||
|
if "oidc_cached_userdata" in flask.session:
|
||||||
|
flask.g.fas_user = munch.Munch(**flask.session["oidc_cached_userdata"])
|
||||||
|
+ # Edge case, avoid 'KeyError' after pagure update if a cached session is used
|
||||||
|
+ flask.g.fas_user.can_create = flask.g.fas_user.get("can_create", False)
|
||||||
|
elif oidc.user_loggedin and "oidc_logintime" in flask.session:
|
||||||
|
email_key, fulln_key, usern_key, ssh_key, groups_key = [
|
||||||
|
pagure_config["OIDC_PAGURE_EMAIL"],
|
||||||
|
|
||||||
|
From 6ff9732cb86b305ebcc32cdb0e7ff578171f4dd1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dominik Wombacher <dominik@wombacher.cc>
|
||||||
|
Date: May 27 2024 18:54:54 +0000
|
||||||
|
Subject: [PATCH 2/2] fix(5.14.x): Use '==' instead of 'is' in template if condition because of old Jinja2 version on EL8
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
diff --git a/pagure/templates/master.html b/pagure/templates/master.html
|
||||||
|
index 4e2bc55..fa23194 100644
|
||||||
|
--- a/pagure/templates/master.html
|
||||||
|
+++ b/pagure/templates/master.html
|
||||||
|
@@ -40,7 +40,7 @@
|
||||||
|
{% if (config.get('ENABLE_NEW_PROJECTS', True) and config.get('ENABLE_UI_NEW_PROJECTS', True))
|
||||||
|
or config.get('ENABLE_GROUP_MNGT', False) %}
|
||||||
|
{#can_create is only defined if using OIDC so assume we cancreate #}
|
||||||
|
- {% if (g.fas_user.can_create is not defined) or (g.fas_user.can_create is true)%}
|
||||||
|
+ {% if (g.fas_user.can_create is not defined) or (g.fas_user.can_create == true)%}
|
||||||
|
<li class="nav-item dropdown ml-3">
|
||||||
|
<a class="nav-link dropdown-toggle font-weight-bold"
|
||||||
|
data-toggle="dropdown"
|
||||||
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri May 31 23:06:38 UTC 2024 - Dominik Wombacher <dominik@wombacher.cc>
|
||||||
|
|
||||||
|
- Backport patches to fix issues after 5.14.1 release (https://pagure.io/pagure/pull-request/5486)
|
||||||
|
- fix(5.14.x): Use '==' instead of 'is' in template if condition because to work with old Jinja2 versions
|
||||||
|
- fix(oidc): Edge case, avoid 'KeyError' after pagure update if a cached session is used
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun May 26 20:11:46 UTC 2024 - Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
|
Sun May 26 20:11:46 UTC 2024 - Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
|
||||||
|
|
||||||
|
@ -40,6 +40,11 @@ Source1: https://raw.githubusercontent.com/fedora-infra/python-fedora/471
|
|||||||
# SUSE-specific README providing a quickstart guide
|
# SUSE-specific README providing a quickstart guide
|
||||||
Source10: pagure-README.SUSE
|
Source10: pagure-README.SUSE
|
||||||
|
|
||||||
|
# fix(5.14.x): Use '==' instead of 'is' in template if condition because to work with older Jinja2 versions
|
||||||
|
# fix(oidc): Edge case, avoid 'KeyError' after pagure update if a cached session is used
|
||||||
|
# https://pagure.io/pagure/pull-request/5486
|
||||||
|
Patch0001: 5486.patch
|
||||||
|
|
||||||
# Backports from upstream
|
# Backports from upstream
|
||||||
|
|
||||||
# SUSE-specific fixes
|
# SUSE-specific fixes
|
||||||
@ -231,7 +236,7 @@ Conflicts: %{name}-theme-default
|
|||||||
Provides: %{name}-theme-default
|
Provides: %{name}-theme-default
|
||||||
Requires: %{name}-theme-chameleon = %{version}-%{release}
|
Requires: %{name}-theme-chameleon = %{version}-%{release}
|
||||||
Enhances: (%{name} and branding-openSUSE)
|
Enhances: (%{name} and branding-openSUSE)
|
||||||
Removepathpostfixes: .openSUSE
|
Removepathpostfixes:.openSUSE
|
||||||
|
|
||||||
%description theme-default-openSUSE
|
%description theme-default-openSUSE
|
||||||
This package sets the default web interface assets used for
|
This package sets the default web interface assets used for
|
||||||
|
Loading…
x
Reference in New Issue
Block a user