-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Allow longer firmware filenames #241
Fixes #241
- Loading branch information
1 parent
17e9125
commit 0f5727d
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
openwisp_firmware_upgrader/migrations/0010_alter_firmwareimage_file.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 4.2.13 on 2024-05-30 07:38 | ||
|
||
from urllib.parse import urljoin | ||
from ..settings import FIRMWARE_API_BASEURL, IMAGE_URL_PATH | ||
from django.db import migrations | ||
import openwisp_firmware_upgrader.base.models | ||
import private_storage.fields | ||
import private_storage.storage.files | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("firmware_upgrader", "0009_upgrade_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="firmwareimage", | ||
name="file", | ||
field=private_storage.fields.PrivateFileField( | ||
max_length=255, | ||
storage=private_storage.storage.files.PrivateFileSystemStorage( | ||
base_url=urljoin(FIRMWARE_API_BASEURL, IMAGE_URL_PATH), | ||
), | ||
upload_to=openwisp_firmware_upgrader.base.models.get_build_directory, | ||
verbose_name="File", | ||
), | ||
), | ||
] |
30 changes: 30 additions & 0 deletions
30
tests/openwisp2/sample_firmware_upgrader/migrations/0004_alter_firmwareimage_file.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 4.2.13 on 2024-05-30 07:51 | ||
|
||
from urllib.parse import urljoin | ||
from openwisp_firmware_upgrader.settings import FIRMWARE_API_BASEURL, IMAGE_URL_PATH | ||
from django.db import migrations | ||
import openwisp_firmware_upgrader.base.models | ||
import private_storage.fields | ||
import private_storage.storage.files | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("sample_firmware_upgrader", "0003_create_device_firmware"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="firmwareimage", | ||
name="file", | ||
field=private_storage.fields.PrivateFileField( | ||
max_length=255, | ||
storage=private_storage.storage.files.PrivateFileSystemStorage( | ||
base_url=urljoin(FIRMWARE_API_BASEURL, IMAGE_URL_PATH), | ||
), | ||
upload_to=openwisp_firmware_upgrader.base.models.get_build_directory, | ||
verbose_name="File", | ||
), | ||
), | ||
] |