Skip to content

Commit

Permalink
Break out the half of business_logic.py into models.py
Browse files Browse the repository at this point in the history
This breaks out the Workspace, ReleaseRequest, and CodeRepo classes (and
their dependant sub-objects) into a new models.py file.

This is just moving code around and changing imports, there's no actualy
code changes. It also splits half the even larger test_business_logic.py
file into a test_models.py file to match.

This and the preceding changes takes the currently 2200 line
business_logic.py file down to 1198, with models.py clocking in at 896.
Likewise, the test_business_logic.py is currently at 4008 lines, but
this change splits it into two files, 2935 and 797 respectively.

There may be futher changes and cleanups possilbe here - this commit
limits itself to mechanical changes to split files.
  • Loading branch information
bloodearnest committed Aug 28, 2024
1 parent 55fd1ce commit 66c8ca2
Show file tree
Hide file tree
Showing 16 changed files with 1,754 additions and 1,676 deletions.
907 changes: 18 additions & 889 deletions airlock/business_logic.py

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions airlock/file_browser_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
from typing import Protocol

from airlock import renderers
from airlock.business_logic import (
ROOT_PATH,
from airlock.enums import PathType, RequestFileType, WorkspaceFileStatus
from airlock.models import (
CodeRepo,
ReleaseRequest,
Workspace,
)
from airlock.enums import PathType, RequestFileType, WorkspaceFileStatus
from airlock.types import FileMetadata, UrlPath
from airlock.types import ROOT_PATH, FileMetadata, UrlPath
from airlock.users import User
from airlock.utils import is_valid_file_type
from airlock.visibility import RequestFileStatus
Expand Down
2 changes: 1 addition & 1 deletion airlock/forms.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django import forms
from django.forms.formsets import BaseFormSet, formset_factory

from airlock.business_logic import FileGroup
from airlock.enums import RequestFileType, Visibility
from airlock.models import FileGroup


class ListField(forms.Field):
Expand Down
Loading

0 comments on commit 66c8ca2

Please sign in to comment.