@@ -343,14 +343,6 @@ def clean_content(self):
343343 def clean_txt (self ):
344344 return get_cleaned_text_file_content (self .cleaned_data ["txt" ])
345345
346- def save (self , group , rev ):
347- filename = os .path .join (settings .CHARTER_PATH , '%s-%s.txt' % (group .charter .canonical_name (), rev ))
348- with open (filename , 'wb' ) as destination :
349- if self .cleaned_data ['txt' ]:
350- destination .write (self .cleaned_data ['txt' ])
351- else :
352- destination .write (self .cleaned_data ['content' ].encode ("utf-8" ))
353-
354346@login_required
355347def submit (request , name = None , option = None ):
356348 if not name .startswith ('charter-' ):
@@ -390,7 +382,12 @@ def submit(request, name=None, option=None):
390382 e .save ()
391383
392384 # Save file on disk
393- form .save (group , charter .rev )
385+ filename = os .path .join (settings .CHARTER_PATH , '%s-%s.txt' % (charter .canonical_name (), charter .rev ))
386+ with open (filename , 'wb' ) as destination :
387+ if form .cleaned_data ['txt' ]:
388+ destination .write (form .cleaned_data ['txt' ])
389+ else :
390+ destination .write (form .cleaned_data ['content' ].encode ("utf-8" ))
394391
395392 if option in ['initcharter' ,'recharter' ] and charter .ad == None :
396393 charter .ad = getattr (group .ad_role (),'person' ,None )
0 commit comments