Skip to content

Commit 6950c75

Browse files
ENG-6656: Fix more templates links (#1496)
Co-authored-by: Ahmad Hakim <[email protected]>
1 parent 6651ee1 commit 6950c75

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pcweb/pages/gallery/apps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pcweb.pages.gallery import gallery
88
from pcweb.components.button import button, button_with_icon
99
from pcweb.components.code_card import gallery_app_card
10-
10+
import copy
1111

1212
GALLERY_APPS_PATH = "templates/"
1313

@@ -28,12 +28,12 @@ def get_route(path: str):
2828

2929
paths = flexdown.utils.get_flexdown_files(GALLERY_APPS_PATH)
3030
gallery_apps_data = get_gallery_apps(paths)
31-
gallery_apps_data_copy = gallery_apps_data.copy()
3231

3332

3433
def more_posts(current_post: dict) -> rx.Component:
3534
posts = []
36-
app_items = list(gallery_apps_data_copy.items())
35+
app_copy = copy.deepcopy(gallery_apps_data)
36+
app_items = list(app_copy.items())
3737
current_index = next(
3838
(
3939
i

pcweb/pages/hosting/views/templates.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import reflex as rx
2+
import copy
23

34

45
def gallery_app_card(app: dict) -> rx.Component:
@@ -49,8 +50,10 @@ def gallery_app_card(app: dict) -> rx.Component:
4950
def component_grid() -> rx.Component:
5051
from pcweb.pages.gallery.apps import gallery_apps_data
5152

53+
apps_copy = copy.deepcopy(gallery_apps_data)
54+
5255
posts = []
53-
for path, document in list(gallery_apps_data.items()):
56+
for path, document in list(apps_copy.items()):
5457
document.metadata["url"] = document.metadata["title"]
5558
document.metadata["title"] = templates_name_map.get(
5659
document.metadata["title"], document.metadata["title"]

0 commit comments

Comments
 (0)