Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
Upgrade
- coverage,
- django-test-migrations
- django-debug-toolbar
- gunicorn
- sentry-sdk
- django-bootstrap4
- django-cleanup
- Pillow
- django-import-export
- django-object-actions
- django-pwa
  • Loading branch information
EricTRL committed Nov 1, 2024
1 parent c8e374e commit 11af516
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 32 deletions.
9 changes: 7 additions & 2 deletions inventory/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportActionMixin
from import_export.fields import Field
from import_export.forms import ExportForm
from import_export.formats.base_formats import CSV, ODS, TSV, XLSX
from import_export.resources import ModelResource

from inventory.models import *
Expand Down Expand Up @@ -43,7 +45,7 @@ class OwnershipValueResource(ModelResource):

class Meta:
model = OwnershipValueProxy
fields = ("id", "group__name", "value")
fields = ("id", "group__name", "value", "item_type", "item_name")
export_order = ("id", "group__name", "item_type", "item_name", "value")

def dehydrate_item_type(self, ownership):
Expand All @@ -59,7 +61,10 @@ class OwnershipValues(ExportActionMixin, admin.ModelAdmin):
list_display_links = ("owner",)
list_filter = ("group",)
fields = ("value",)
resource_class = OwnershipValueResource

export_form_class = ExportForm
formats = (CSV, XLSX, TSV, ODS)
resource_classes = [OwnershipValueResource]

def get_queryset(self, request):
return super(OwnershipValues, self).get_queryset(request).filter(group__isnull=False)
Expand Down
2 changes: 1 addition & 1 deletion inventory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def owner(self):

def clean_fields(self, exclude=None):
super().clean_fields(exclude=exclude)
# Make exlude a list to prevent complex if statements
# Make exclude a list to prevent complex if statements
exclude = exclude or []

if "content_type" not in exclude and "object_id" not in exclude:
Expand Down
23 changes: 8 additions & 15 deletions membership_file/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from django.contrib import admin, messages
from django_object_actions import DjangoObjectActions, action as object_action
from import_export.admin import ExportActionMixin
from import_export.formats.base_formats import CSV, TSV, ODS, XLSX
from import_export.forms import ExportForm
from import_export.formats.base_formats import CSV, ODS, TSV, XLSX

from core.admin import DisableModificationsAdminMixin, URLLinkInlineAdminMixin
from membership_file.forms import AdminMemberForm
Expand Down Expand Up @@ -58,13 +59,9 @@ class MemberLogReadOnlyInline(DisableModificationsAdminMixin, URLLinkInlineAdmin
class MemberWithLog(RequestUserToFormModelAdminMixin, DjangoObjectActions, ExportActionMixin, HideRelatedNameAdmin):
##############################
# Export functionality
resource_class = MemberResource
formats = (
CSV,
XLSX,
TSVUnicodeBOM,
ODS,
)
resource_classes = [MemberResource]
export_form_class = ExportForm
formats = (CSV, XLSX, TSV, ODS)

@object_action(attrs={"class": "addlink"})
def register_new_member(modeladmin, request, queryset):
Expand Down Expand Up @@ -296,13 +293,9 @@ class RoomAdmin(admin.ModelAdmin):
class MemberYearAdmin(ExportActionMixin, admin.ModelAdmin):
##############################
# Export functionality
resource_class = MembersFinancialResource
formats = (
CSV,
XLSX,
TSVUnicodeBOM,
ODS,
)
resource_classes = [MembersFinancialResource]
export_form_class = ExportForm
formats = (CSV, XLSX, TSV, ODS)

def has_export_permission(self, request):
return request.user.has_perm("membership_file.can_export_membership_file")
Expand Down
4 changes: 2 additions & 2 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

-r prod.txt

coverage~=7.5.3 # Code Coverage
django-test-migrations~=1.3.0 # Testing migrations
coverage~=7.6.4 # Code Coverage
django-test-migrations~=1.4.0 # Testing migrations
14 changes: 7 additions & 7 deletions requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

# Import the common-dependencies
Django~=4.2.16
django-bootstrap4~=22.2
django-cleanup~=8.1.0 # Removes old FileField files upon saving
django-bootstrap4~=24.4
django-cleanup~=9.0.0 # Removes old FileField files upon saving
djangorestframework~=3.15.1 # TODO: Deprecate
Pillow~=10.3.0 # ImageField support
Pillow~=11.0.0 # ImageField support
django-ical~=1.9.2 # iCalendar export
django-recurrence~=1.11.1 # Recurring Dates
django-import-export~=2.9.0 # Import/Export models
django-import-export[xlsx,ods]~=4.2.0 # Import/Export models
django-dynamic-preferences~=1.16.0 # Global Preferences / User Preferences
django-object-actions~=4.2.0 # Dynamic admin panel actions
django-object-actions~=4.3.0 # Dynamic admin panel actions
martor~=1.6.44; # Markdown Editor
pymdown-extensions~=9.11 # Extra markdown features
django-pwa~=1.1.0 # Progressive Webapp
pymdown-extensions~=9.11 # Extra markdown features (Cannot upgrade due to martor, which requires Markdown<3.6)
django-pwa~=2.0.1 # Progressive Webapp
requests~=2.32.3 # Requests (needed for Mailcow API)
django-tempus-dominus~=5.1.2.17 # DateTimePicker
easywebdav~=1.2.0 # For Nextcloud
6 changes: 3 additions & 3 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
-r common.txt

# Import the dev-dependencies
coverage~=6.4.4 # Code Coverage
django-debug-toolbar~=3.6.0 # Debug Panel
django-test-migrations~=1.3.0 # Testing migrations
coverage~=7.6.4 # Code Coverage
django-debug-toolbar~=4.4.6 # Debug Panel
django-test-migrations~=1.4.0 # Testing migrations
black # Linting
aiosmtpd # Email debugging
4 changes: 2 additions & 2 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
-r common.txt

# Import the prod-dependencies
gunicorn~=22.0.0
sentry-sdk~=2.3.1
gunicorn~=23.0.0
sentry-sdk~=2.17.0

0 comments on commit 11af516

Please sign in to comment.