Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions shared/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ def get_packet_file_path():
def fetch_packet():
if settings.SPONSORSHIP_PACKET_FILE and settings.SPONSORSHIP_PACKET_URL:
if not os.path.exists(get_packet_file_path()):
print("Downloading the sponsorship packet to: {}", get_packet_file_path())

r = requests.get(settings.SPONSORSHIP_PACKET_URL, stream=True)
if r.status_code == 200:
with open(get_packet_file_path(), 'wb') as f:
for chunk in r.iter_content(1024):
f.write(chunk)
f.write(chunk)