add note
parent
3def5b099b
commit
6ba290fab6
|
@ -467,6 +467,10 @@ def upload_sub_banner(v:User, sub:str):
|
||||||
sub.bannerurls.append(bannerurl)
|
sub.bannerurls.append(bannerurl)
|
||||||
else:
|
else:
|
||||||
sub.bannerurls = [bannerurl]
|
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')
|
flag_modified(sub, 'bannerurls')
|
||||||
g.db.add(sub)
|
g.db.add(sub)
|
||||||
|
|
||||||
|
@ -498,6 +502,7 @@ def delete_sub_banner(v:User, sub:str, index:int):
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
del sub.bannerurls[index]
|
del sub.bannerurls[index]
|
||||||
|
flag_modified(sub, 'bannerurls') # see the note in upload_sub_banner
|
||||||
g.db.add(sub)
|
g.db.add(sub)
|
||||||
|
|
||||||
ma = SubAction(
|
ma = SubAction(
|
||||||
|
|
Loading…
Reference in New Issue