Skip to content

Commit

Permalink
Fix format to work with newer flake
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed Oct 31, 2024
1 parent 03da535 commit d52c3aa
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/ralph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def monkey_options_init(self, meta, app_label):
self._old__init__(meta, app_label)
self.default_permissions = ('add', 'change', 'delete', 'view')

# TODO: create PR to Django - default_permissions from settings

Options._old__init__ = Options.__init__
Options.__init__ = lambda self, meta, app_label=None: monkey_options_init(
self, meta, app_label
Expand Down
28 changes: 14 additions & 14 deletions src/ralph/accounts/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
from ralph.lib.transitions.models import Transition
from ralph.sim_cards.models import SIMCard

ACCEPTANCE_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_ID'] # noqa: E509
ACCEPTANCE_SIM_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_SIM_ID'] # noqa: E509
ACCEPTANCE_BACK_OFFICE_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_ACCEPT_STATUS'] # noqa: E509
ACCEPTANCE_SIMCARD_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['SIMCARD_ACCEPT_STATUS'] # noqa: E509
ACCEPTANCE_LOAN_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['LOAN_TRANSITION_ID'] # noqa: E509
ACCEPTANCE_BACK_OFFICE_ACCEPT_LOAN_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_ACCEPT_LOAN_STATUS'] # noqa: E509
ACCEPTANCE_RETURN_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['RETURN_TRANSITION_ID'] # noqa: E509
ACCEPTANCE_BACK_OFFICE_RETURN_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_ACCEPT_RETURN_STATUS'] # noqa: E509
ACCEPTANCE_ACCESS_CARD_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_ACCESS_CARD_ID'] # noqa: E509
ACCEPTANCE_ACCESS_CARD_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['ACCESS_CARD_ACCEPT_ACCEPT_STATUS'] # noqa: E509
ACCEPTANCE_BACK_OFFICE_TEAM_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_TEAM_ACCEPT_STATUS'] # noqa: E509
ACCEPTANCE_TEAM_ACCEPT_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_TEAM_ACCEPT_ID'] # noqa: E509
ACCEPTANCE_BACK_OFFICE_TEST_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_TEST_ACCEPT_STATUS'] # noqa: E509
ACCEPTANCE_TEST_ACCEPT_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_TEST_ACCEPT_ID'] # noqa: E509
ACCEPTANCE_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_ID'] # noqa
ACCEPTANCE_SIM_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_SIM_ID'] # noqa
ACCEPTANCE_BACK_OFFICE_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_ACCEPT_STATUS'] # noqa
ACCEPTANCE_SIMCARD_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['SIMCARD_ACCEPT_STATUS'] # noqa
ACCEPTANCE_LOAN_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['LOAN_TRANSITION_ID'] # noqa
ACCEPTANCE_BACK_OFFICE_ACCEPT_LOAN_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_ACCEPT_LOAN_STATUS'] # noqa
ACCEPTANCE_RETURN_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['RETURN_TRANSITION_ID'] # noqa
ACCEPTANCE_BACK_OFFICE_RETURN_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_ACCEPT_RETURN_STATUS'] # noqa
ACCEPTANCE_ACCESS_CARD_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_ACCESS_CARD_ID'] # noqa
ACCEPTANCE_ACCESS_CARD_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['ACCESS_CARD_ACCEPT_ACCEPT_STATUS'] # noqa
ACCEPTANCE_BACK_OFFICE_TEAM_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_TEAM_ACCEPT_STATUS'] # noqa
ACCEPTANCE_TEAM_ACCEPT_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_TEAM_ACCEPT_ID'] # noqa
ACCEPTANCE_BACK_OFFICE_TEST_ACCEPT_STATUS = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['BACK_OFFICE_TEST_ACCEPT_STATUS'] # noqa
ACCEPTANCE_TEST_ACCEPT_TRANSITION_ID = settings.ACCEPT_ASSETS_FOR_CURRENT_USER_CONFIG['TRANSITION_TEST_ACCEPT_ID'] # noqa


def transition_exists(transition_id):
Expand Down
1 change: 1 addition & 0 deletions src/ralph/accounts/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def mirror_groups(self):

self._user.groups.set(existing_groups + new_groups)


_LDAPUser._mirror_groups_original = _LDAPUser._mirror_groups
_LDAPUser._mirror_groups = mirror_groups

Expand Down
1 change: 1 addition & 0 deletions src/ralph/api/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ def get(self, request, *args, **kwargs):

return APIRoot.as_view()


router = RalphRouter()
1 change: 1 addition & 0 deletions src/ralph/assets/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class Meta:
'parent'
)


# TODO: Is there a better way to make it work since drf 3.5?
del ConfigurationClassSimpleSerializer._declared_fields['tags']

Expand Down
1 change: 1 addition & 0 deletions src/ralph/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def generate_pdf_response(pdf_data, file_name):
)
return response


CACHE_DEFAULT = object()


Expand Down
1 change: 1 addition & 0 deletions src/ralph/lib/metrics/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def build_statsd_client(
ipv6=ipv6
)


if settings.COLLECT_METRICS and statsd is None:
statsd = build_statsd_client()

Expand Down
1 change: 1 addition & 0 deletions src/ralph/licences/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def get_queryset(self):
}
)


LICENCES_RELATED_OBJECTS_PREFETCH_RELATED = [
'users',
# prefetch all baseobjects related with licence; this allows to call
Expand Down
2 changes: 2 additions & 0 deletions src/ralph/networks/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def get_private_network_filter():
max_ip = int(network.broadcast_address)
filter_ |= Q(min_ip__gte=min_ip, max_ip__lte=max_ip)
return filter_


PRIVATE_NETWORK_FILTER = get_private_network_filter()


Expand Down
1 change: 1 addition & 0 deletions src/ralph/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def only_true(request):
'''For django debug toolbar.'''
return True


DEBUG = True

INSTALLED_APPS = INSTALLED_APPS + (
Expand Down

0 comments on commit d52c3aa

Please sign in to comment.