@@ -33,8 +33,8 @@ def create_preivew_badge_pdf(badgeForms):
3333 font_weight = []
3434 font_style = []
3535 text_decoration = []
36- if badge_field . get ( 'font_weight' ) :
37- for item in badge_field . get ( 'font_weight' ) :
36+ if badge_field [ 'font_weight' ] :
37+ for item in badge_field [ 'font_weight' ] :
3838 if item .get ('font_weight' ):
3939 font_weight .append (item .get ('font_weight' ))
4040 if item .get ('font_style' ):
@@ -148,27 +148,27 @@ def create_print_badge_pdf(badge_form, ticket_holder, list_field_show):
148148 font_weight = []
149149 font_style = []
150150 text_decoration = []
151- if badge_field .get ('font_weight' ):
152- for item in badge_field .get ('font_weight' ):
151+ badge_field .font_weight_tmp = badge_field .font_weight
152+ if badge_field .font_weight :
153+ for item in badge_field .font_weight :
153154 if item .get ('font_weight' ):
154155 font_weight .append (item .get ('font_weight' ))
155156 if item .get ('font_style' ):
156157 font_style .append (item .get ('font_style' ))
157158 if item .get ('text_decoration' ):
158159 text_decoration .append (item .get ('text_decoration' ))
159160 if not font_weight :
160- badge_field [ ' font_weight' ] = 'none'
161+ badge_field . font_weight = 'none'
161162 else :
162- badge_field [ ' font_weight' ] = ',' .join (font_weight )
163+ badge_field . font_weight = ',' .join (font_weight )
163164 if not font_style :
164- badge_field [ ' font_style' ] = 'none'
165+ badge_field . font_style = 'none'
165166 else :
166- badge_field [ ' font_style' ] = ',' .join (font_style )
167+ badge_field . font_style = ',' .join (font_style )
167168 if not text_decoration :
168- badge_field [ ' text_decoration' ] = 'none'
169+ badge_field . text_decoration = 'none'
169170 else :
170- badge_field ['text_decoration' ] = ',' .join (text_decoration )
171-
171+ badge_field .text_decoration = ',' .join (text_decoration )
172172 create_save_pdf (
173173 render_template (
174174 'pdf/badge_forms.html' , badgeForms = badge_form , badgeFieldForms = badgeFieldForms
@@ -178,5 +178,7 @@ def create_print_badge_pdf(badge_form, ticket_holder, list_field_show):
178178 )
179179 ticket_holder .is_badge_printed = True
180180 ticket_holder .badge_printed_at = datetime .now ()
181+ for badge_field in badgeFieldForms :
182+ badge_field .font_weight = badge_field .font_weight_tmp
181183 save_to_db (ticket_holder , 'Ticket Holder saved' )
182184 return file_pdf_path (badge_form )
0 commit comments