Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update __init__.py #13

Closed
wants to merge 1 commit into from
Closed

Conversation

prakhar-goel
Copy link

Fixed this error, caused by performing string manipulation on a function:

related_admin/__init__.py", line 69, in __new__
    if '__' in field[1:-1] and not hasattr(new_class, field):
TypeError: 'function' object is not subscriptable

list_display can also contain functions. Added check that fields in list_display are only strings.

Fixed this error, caused by performing string manipulation on a function:
```
related_admin/__init__.py", line 69, in __new__
    if '__' in field[1:-1] and not hasattr(new_class, field):
TypeError: 'function' object is not subscriptable
```
`list_display` can also contain `functions`. Added check that fields in `list_display` are only strings.
@prakhar-goel
Copy link
Author

Fixed this error, caused by performing string manipulation on a function:

related_admin/__init__.py", line 69, in __new__
    if '__' in field[1:-1] and not hasattr(new_class, field):
TypeError: 'function' object is not subscriptable

list_display can also contain functions. Added check that fields in list_display are only strings.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.04%) to 98.958% when pulling 1439857 on prakhar-goel:master into babb9b8 on PetrDlouhy:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.04%) to 98.958% when pulling 1439857 on prakhar-goel:master into babb9b8 on PetrDlouhy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.04%) to 98.958% when pulling 1439857 on prakhar-goel:master into babb9b8 on PetrDlouhy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.04%) to 98.958% when pulling 1439857 on prakhar-goel:master into babb9b8 on PetrDlouhy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.04%) to 98.958% when pulling 1439857 on prakhar-goel:master into babb9b8 on PetrDlouhy:master.

@PetrDlouhy
Copy link
Owner

@prakhar-goel Thank you very much for the fix. Can you please add test for this error?

@prakhar-goel
Copy link
Author

Hi @PetrDlouhy, did you get a chance to approve the pull request please?

@prakhar-goel
Copy link
Author

Ok just saw your previous comment regarding tests. I ain't a pro at writing tests. Can you please guide me.

@PetrDlouhy
Copy link
Owner

I have reworked this and write the test. So I am closing the PR.

@PetrDlouhy PetrDlouhy closed this Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants