File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1111
1212def give_all_app_perms_to_group (app_label , group ):
1313 for ctype in ContentType .objects .filter (app_label = app_label ):
14- for perm in ctype .permission_set .all ():
14+ for perm in ctype .permission_set .all (): # type: ignore
1515 perm .group_set .add (group ) # type: ignore
1616
1717
@@ -55,14 +55,21 @@ def ensure_groups_exist(group_names):
5555 return [Group .objects .get_or_create (name = group_name )[0 ] for group_name in group_names ]
5656
5757
58- def get_code (path ):
58+ REMAP_MODULES = {
59+ "events.hitpoint2017" : "zombies.hitpoint2017" ,
60+ }
61+
62+
63+ def get_code (path : str ):
5964 """
60- Given "core.utils:get_code", imports the module "core.utils" and returns
65+ Given "core.utils.misc_utils :get_code", imports the module "core.utils.misc_utils " and returns
6166 "get_code" from it.
6267 """
6368 from importlib import import_module
6469
6570 module_name , member_name = path .split (":" )
71+ module_name = REMAP_MODULES .get (module_name , module_name )
72+
6673 module = import_module (module_name )
6774 return getattr (module , member_name )
6875
You can’t perform that action at this time.
0 commit comments