Commit 0263aeb4 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

make rpc_groups attribute optional

parent 534625cb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -88,13 +88,14 @@ def parameters(fn_name):
@register.filter(name="rpc_groups_from_function")
def rpc_groups_from_function(fn_name: str) -> str:
    fn = all_methods[fn_name]
    return " ".join(fn.rpc_groups)
    return " ".join(getattr(fn, "rpc_groups", []))


@register.filter(name="rpc_groups_as_list")
def rpc_groups_as_list(fns) -> list:
    groups = []
    for _, fn in fns:
        for group in fn.rpc_groups:
        grps = getattr(fn, "rpc_groups", [])
        for group in grps:
            groups.append(group)
    return list(set(groups))