Skip to content

Commit

Permalink
[fix] Allow longer firmware filenames #241
Browse files Browse the repository at this point in the history
Fixes #241
  • Loading branch information
praptisharma28 authored May 30, 2024
1 parent 17e9125 commit 0f5727d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions openwisp_firmware_upgrader/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class AbstractFirmwareImage(TimeStampedEditableModel):
upload_to=get_build_directory,
max_file_size=app_settings.MAX_FILE_SIZE,
storage=app_settings.PRIVATE_STORAGE_INSTANCE,
max_length=255,
)
type = models.CharField(
blank=True,
Expand Down
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",
),
),
]
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",
),
),
]

0 comments on commit 0f5727d

Please sign in to comment.