From 6ba290fab60c6df4f48195dfcef74a3434952bd1 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Fri, 9 Dec 2022 21:43:36 -0600 Subject: [PATCH] add note --- files/routes/subs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/routes/subs.py b/files/routes/subs.py index cea5fcf97..ee3b93548 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -467,6 +467,10 @@ def upload_sub_banner(v:User, sub:str): sub.bannerurls.append(bannerurl) else: sub.bannerurls = [bannerurl] + # while testing it seems sqlalchemy doesn't seem to recognize an array + # column being updated. in order to get around this, we manually set + # the modified flag + # TODO: is there a more elegant way for this? flag_modified(sub, 'bannerurls') g.db.add(sub) @@ -498,6 +502,7 @@ def delete_sub_banner(v:User, sub:str, index:int): except FileNotFoundError: pass del sub.bannerurls[index] + flag_modified(sub, 'bannerurls') # see the note in upload_sub_banner g.db.add(sub) ma = SubAction(