mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 12:21:02 +01:00
style(flake8): enable B010 (#12424)
* style(flake8): enable B010 * Ignore mypy
This commit is contained in:
parent
05c511670d
commit
4d724c1edc
1
.flake8
1
.flake8
@ -13,7 +13,6 @@ ignore=
|
||||
B001, # Do not use bare `except:`.
|
||||
B006, # Do not use mutable data structures for argument defaults.
|
||||
B011, # Do not call assert False since python -O removes these calls
|
||||
B010, # Do not call setattr with a constant attribute value, it is not any safer than normal property access.
|
||||
B017, # assertRaises(Exception): should be considered evil
|
||||
B019, # Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks.
|
||||
B024, # ClickhouseFunnelBase is an abstract base class, but it has no abstract methods. Remember to use @abstractmethod, @abstractclassmethod and/or @abstractproperty decorators.
|
||||
|
@ -35,7 +35,7 @@ class PersonalAPIKeySerializerCreateOnly(serializers.ModelSerializer):
|
||||
value = generate_random_token_personal()
|
||||
secure_value = hash_key_value(value)
|
||||
personal_api_key = PersonalAPIKey.objects.create(user=user, secure_value=secure_value, **validated_data)
|
||||
setattr(personal_api_key, "_value", value)
|
||||
personal_api_key._value = value # type: ignore
|
||||
return personal_api_key
|
||||
|
||||
|
||||
|
@ -147,7 +147,7 @@ class AutoProjectMiddleware:
|
||||
user.current_organization_id = actual_item_team.organization_id
|
||||
user.save()
|
||||
# Information for POSTHOG_APP_CONTEXT
|
||||
setattr(request, "switched_team", current_team.id)
|
||||
request.switched_team = current_team.id # type: ignore
|
||||
|
||||
|
||||
class CHQueries:
|
||||
|
@ -34,7 +34,7 @@ class ElementGroupManager(models.Manager):
|
||||
)
|
||||
for element in elements:
|
||||
element.group = group
|
||||
setattr(element, "pk", None)
|
||||
element.pk = None
|
||||
Element.objects.bulk_create(elements)
|
||||
return group
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user