WebHost: fix uploading .archipelago files
This commit is contained in:
		
							parent
							
								
									82e180cca8
								
							
						
					
					
						commit
						7e32fa1311
					
				|  | @ -108,12 +108,13 @@ def uploads(): | ||||||
|                         elif res: |                         elif res: | ||||||
|                             return redirect(url_for("view_seed", seed=res.id)) |                             return redirect(url_for("view_seed", seed=res.id)) | ||||||
|                 else: |                 else: | ||||||
|  |                     file.seek(0)  # offset from is_zipfile check | ||||||
|                     # noinspection PyBroadException |                     # noinspection PyBroadException | ||||||
|                     try: |                     try: | ||||||
|                         multidata = file.read() |                         multidata = file.read() | ||||||
|                         MultiServer.Context.decompress(multidata) |                         MultiServer.Context.decompress(multidata) | ||||||
|                     except: |                     except Exception as e: | ||||||
|                         flash("Could not load multidata. File may be corrupted or incompatible.") |                         flash(f"Could not load multidata. File may be corrupted or incompatible. ({e})") | ||||||
|                     else: |                     else: | ||||||
|                         seed = Seed(multidata=multidata, owner=session["_id"]) |                         seed = Seed(multidata=multidata, owner=session["_id"]) | ||||||
|                         flush()  # place into DB and generate ids |                         flush()  # place into DB and generate ids | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue