Skip to content

Fix for crashing when function alias provided that has NoneType for inspect.getmodule(value)#15

Merged
imakecodes merged 2 commits into
makecodes:mainfrom
evgenyslab:main
Mar 6, 2024
Merged

Fix for crashing when function alias provided that has NoneType for inspect.getmodule(value)#15
imakecodes merged 2 commits into
makecodes:mainfrom
evgenyslab:main

Conversation

@evgenyslab

Copy link
Copy Markdown
Contributor

Generation crashes when using a model with a property as such:

from datetime import date
from model_utils.models import TimeStampedModel

class MyModel(TimeStampedModel):
   some_date = models.DateField(default=date.today, verbose_name="someDate")

^ this will crash because inspect.getmodule(value) when value = date.today returns NoneType which has no __name__.

@imakecodes imakecodes merged commit d9dff66 into makecodes:main Mar 6, 2024
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.

2 participants