You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue lies here, in the import_local function:
def import_local(path_to_object)
path, name = path_to_object.rsplit('.', 1)
app = path.split('.')[0] # Assumes the app is the 0th element of the path
if app not in settings.INSTALLED_APPS:
raise AssertionError()
Restricting possible app names to the 0th element of the path means we ignore apps with compound paths. Solution should check INSTALLED_APPS for all iterations of the path.
The text was updated successfully, but these errors were encountered:
mhotwagner
pushed a commit
to mhotwagner/django-rest-framework-serializer-extensions
that referenced
this issue
Aug 14, 2017
- Checks all possible iterations of app name against `INSTALLED_APPS`, so `app.sub_app.module.Class` checks `INSTALLED_APPS` for `app.sub_app.module`, then `app.sub_app`, then `app`, instead of just checking for `app`.
- Adds test to characterize new import behavior.
- Fixes issue evenicoulddoit#13
The local import utility handles apps with simple paths (no-dot), but fails on apps with compound paths (ie, dots). So, this works fine:
But this fails:
The issue lies here, in the import_local function:
Restricting possible app names to the 0th element of the path means we ignore apps with compound paths. Solution should check
INSTALLED_APPS
for all iterations of the path.The text was updated successfully, but these errors were encountered: