Skip to content

Commit

Permalink
revert failing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilsAutumn committed Aug 29, 2024
1 parent 797d002 commit 0caadf9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/src/zango/apps/accesslogs/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def user_logged_in_handler(sender, request, user, **kwargs):

if getattr(request, "selected_role_id", ""):
user_role = UserRoleModel.objects.filter(
id=request.selected_role_id
id=getattr(request, "selected_role_id")
).last()

if user_role:
Expand Down
4 changes: 2 additions & 2 deletions backend/src/zango/apps/auditlogs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections.abc import Callable
from copy import deepcopy
from datetime import timezone
from typing import Any
from typing import Any, Union

from dateutil import parser
from dateutil.tz import gettz
Expand Down Expand Up @@ -531,7 +531,7 @@ def changes_display_dict(self):
return changes_display_dict

def _get_changes_display_for_fk_field(
self, field: models.ForeignKey | models.OneToOneField, value: Any
self, field: Union[models.ForeignKey, models.OneToOneField], value: Any
) -> str:
"""
:return: A string representing a given FK value and the field to which it belongs
Expand Down
8 changes: 4 additions & 4 deletions backend/src/zango/apps/auditlogs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections import defaultdict
from collections.abc import Callable, Collection, Iterable
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Optional, Union

from django.apps import apps
from django.db.models import ManyToManyField, Model
Expand Down Expand Up @@ -207,7 +207,7 @@ def _connect_signals(self, model):
receiver = make_log_m2m_changes(field_name)
self._m2m_signals[model][field_name] = receiver
field = getattr(model, field_name)
m2m_model = field.through
m2m_model = getattr(field, "through")

m2m_changed.connect(
receiver,
Expand All @@ -225,7 +225,7 @@ def _disconnect_signals(self, model):
)
for field_name, receiver in self._m2m_signals[model].items():
field = getattr(model, field_name)
m2m_model = field.through
m2m_model = getattr(field, "through")
m2m_changed.disconnect(
sender=m2m_model,
dispatch_uid=self._dispatch_uid(m2m_changed, receiver),
Expand Down Expand Up @@ -257,7 +257,7 @@ def _get_exclude_models(
]
return exclude_models

def _register_models(self, models: Iterable[str | dict[str, Any]]) -> None:
def _register_models(self, models: Iterable[Union[str, Dict[str, Any]]]) -> None:
models = copy.deepcopy(models)
for model in models:
if isinstance(model, str):
Expand Down
2 changes: 1 addition & 1 deletion backend/src/zango/apps/dynamic_models/workspace/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def match_view(self, request) -> object:
if r_regex.search(path): # match module
module = r["module"] + "." + r["url"]
md = self.plugin_source.load_plugin(module)
urlpatterns = md.urlpatterns
urlpatterns = getattr(md, "urlpatterns")
mod_url_path = path[len(r["re_path"].strip("^")) :] or "/"
for pattern in urlpatterns:
resolve = pattern.resolve(mod_url_path) # find view
Expand Down
2 changes: 1 addition & 1 deletion backend/src/zango/core/internal_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def process_internal_request(fake_request, tenant, **kwargs):
fake_request.internal_routing = True
connection.set_tenant(tenant)
ws_module = import_module("zango.apps.dynamic_models.workspace.base")
ws_klass = ws_module.Workspace
ws_klass = getattr(ws_module, "Workspace")
ws = ws_klass(tenant, fake_request)
ws.ready()
view, resolve = ws.match_view(fake_request)
Expand Down

0 comments on commit 0caadf9

Please sign in to comment.