Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-CSVImport
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-CSVImport
Commits
61b860f8
Verified
Commit
61b860f8
authored
4 years ago
by
Jonathan Weth
Committed by
Nik | Klampfradler
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use Django apps registry to detect if Chronos is installed
parent
e6d3056f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/csv_import/field_types.py
+4
-6
4 additions, 6 deletions
aleksis/apps/csv_import/field_types.py
with
4 additions
and
6 deletions
aleksis/apps/csv_import/field_types.py
+
4
−
6
View file @
61b860f8
from
typing
import
Callable
,
Optional
,
Sequence
,
Tuple
,
Type
from
typing
import
Callable
,
Optional
,
Sequence
,
Tuple
,
Type
from
uuid
import
uuid4
from
uuid
import
uuid4
from
django.apps
import
apps
from
django.db.models
import
Model
from
django.db.models
import
Model
from
django.utils.functional
import
classproperty
from
django.utils.functional
import
classproperty
from
django.utils.translation
import
gettext
as
_
from
django.utils.translation
import
gettext
as
_
...
@@ -282,12 +283,9 @@ class DepartmentsFieldType(ProcessFieldType):
...
@@ -282,12 +283,9 @@ class DepartmentsFieldType(ProcessFieldType):
converter
=
parse_comma_separated_data
converter
=
parse_comma_separated_data
def
process
(
self
,
instance
:
Model
,
value
):
def
process
(
self
,
instance
:
Model
,
value
):
try
:
with_chronos
=
apps
.
is_installed
(
"
aleksis.apps.chronos
"
)
from
aleksis.apps.chronos.models
import
Subject
# noqa
if
with_chronos
:
Subject
=
apps
.
get_model
(
"
chronos
"
,
"
Subject
"
)
with_chronos
=
True
except
ModuleNotFoundError
:
with_chronos
=
False
group_type
=
get_site_preferences
()[
"
csv_import__group_type_departments
"
]
group_type
=
get_site_preferences
()[
"
csv_import__group_type_departments
"
]
group_prefix
=
get_site_preferences
()[
"
csv_import__group_prefix_departments
"
]
group_prefix
=
get_site_preferences
()[
"
csv_import__group_prefix_departments
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment