From f0b665558039eb37ab20fed2474063a295c55cb3 Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Tue, 3 Dec 2024 15:29:17 -0500 Subject: [PATCH] Fix guidebook image export for MIVS/MITS The earlier change silently broke guidebook exports for MIVS or MITS teams that don't have a header or thumbnail. This should fix that. --- celerybeat-schedule | Bin 151552 -> 184320 bytes uber/models/mits.py | 6 ++++-- uber/models/mivs.py | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/celerybeat-schedule b/celerybeat-schedule index bccb2910609edacc5dbc163441258b16cd0025ab..12caa11afc77ccad4d161677bd83e8bedd9fb39a 100644 GIT binary patch delta 2508 zcmbuBZA@EL7{_~VOK(SS=`FP7rS!H)oy-nsd7GicF_`*+(BKf~HXI;?iU?bPp0cwD+CW$7fJTzgDt*hvIfvtmdy~Nf>xxPuRSLg$xC>hSt zAdkIV<_;<6O(_TTOF7(B#=E8Q+{Gj$1i=h%7Ykk5%b&x=n@<8yzu(Kvo6y!$kjx#< zgSQT*Zfvpv?w*^}}1DdSejXe$XRIVxHSDyr`&^CFtwVz_3LUJ#OLL7N#1t za&7Qf{^Mw_4eX#+1E-=^wb#KXR2`dTY9e}c5=ijnf&%p72-st_n_V0~(8a<=+AiA1 zaVhY|<|0(`BWT9u;KuG9WCw3Um1DpO{g1g}cg;GKI|@9s;)!c)OR-$B6CD`^y(HU^ z8Dt@neU_@5&cvur=vfkA?!s|2I1a+3bVKd)%9e^Ea&yg3RH1c0fgF=0<|pV5d6+?_ z12)_nG3n)pV0h&hmXwaFZh#Ba>hLk9dZB6QE4){}=AXUHLMb|}9SEqT9@vm447Srk zKm3xVwxX(1AfXFkaDciF?O-9Te79Xx4eMf53F)W6T9jSJ{Z0%MoX1&QAchL8uGL|s zRByP?#??TU2*`6Qy*?CVyE*e=ZI+K!SV%!8sPv3QRm|4|QIbjcqnD!LFD5W(^&L;4 zL*HXS?3N5(n<6UV${dQc-Qwi6t<_BZBQ6$c;@LkG^(06W^-|T(t$*=KQ!SS@B3RH=BzAWcdScSIY)mvq8}PqK3ZVP@AQ zQIyH%>C0@hjiOA{*%_vKD9WVR>SvgRQtV$)wp)^U?c3{F>fU826W4`i7K)=N%c@RQ zAEOeK+tFKP-1|H+{Inju69QR)Oxsle-ifE}{|7jY0Gw)u!p&)&pcZX5wIhX0VjuM1 z3Y!FVBL0`bvqx7^4maK&Q&iU!>!zGdVtD1(QYGq+yv%a+WTK!pr>gZIMCMw4914yC z2Xs`opg=k>!1_C0E8b+Ys^N9TxU!vR6vMeY+ZE@+_af&aOmQ!kRZ_g>V>Zq!EHN1G zP8K+;$*miS%!$MmM)O|ml2mNf_|LPmd;SJ;uF}NS$f)#^Ccaa08;4_Z&nR-~B_^Mw zmI}uvfzw)jYR6XAP8^yT2Ul^HeCLiJlj-d$(>hzOA+12W!Np8ZuO*BN>Uhz~KbbAlpI022cU`~hOEjk?;5+;_Oa0t^fd43j4_s%}2P7{Ityj8T(!Goyfj b9IpXHJv&g5pK!CBUb~zg<90bcrbmhZ)0q%u diff --git a/uber/models/mits.py b/uber/models/mits.py index 67b3f7fe6..a1d0d7932 100644 --- a/uber/models/mits.py +++ b/uber/models/mits.py @@ -223,10 +223,12 @@ def guidebook_images(self): header = self.guidebook_header thumbnail = self.guidebook_thumbnail - prepend = sluggify(self.name) + '_' - return [prepend + header.filename, prepend + thumbnail.filename], [header, thumbnail] + header_name = (prepend + header.filename) if header else '' + thumbnail_name = (prepend + thumbnail.filename) if thumbnail else '' + + return [header_name, thumbnail_name], [header, thumbnail] class MITSPicture(MagModel): diff --git a/uber/models/mivs.py b/uber/models/mivs.py index a080e173f..8198380b4 100644 --- a/uber/models/mivs.py +++ b/uber/models/mivs.py @@ -515,7 +515,10 @@ def guidebook_images(self): thumbnail = self.guidebook_thumbnail prepend = sluggify(self.title) + '_' - return [prepend + header.filename, prepend + thumbnail.filename], [header, thumbnail] + header_name = (prepend + header.filename) if header else '' + thumbnail_name = (prepend + thumbnail.filename) if thumbnail else '' + + return [header_name, thumbnail_name], [header, thumbnail] class IndieGameImage(MagModel):