Flagsmith / Flagsmith/flagsmith

Using django-lifecycle hooks results in `error: Untyped decorator makes function "x" untyped [misc]`

Open
#5,240 5 comments 0 reactions 1 assignee Assigned to @proguserr View on GitHub
good first issue
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

When using the `@hook` decorator from `django-lifecycle` on a model method, `mypy` throws the following error:

```
error: Untyped decorator makes function "x" untyped [misc]
```

This means that, currently, all methods decorated with `@hook(...)` are annotated with `# type: ignore[misc]`. The goal of this issue is to remove those `type: ignore[misc]` comments, while still having `mypy` pass its validation. Depending on the fix, it may be necessary to split the work up into multiple PRs as there are a lot of instances of this across the codebase.

Here is an example: https://github.com/Flagsmith/flagsmith/blob/main/api/features/models.py#L142

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.