At /nf/admin (only accessible by global admins) create a new left-menu item called 'Add Subscribers' which goes to a new page. On this page, there should be a form to enter a URL and a username. Take the URL and run it through URL dispatch to determine what artifact it goes with (e.g. ticket, wiki page). Note: if the URL dispatch is hard to do at all, we can use a different approach, like separate input boxes for neighborhood, project, tool mount point, ticket number.
Then add the specified username as a subscriber to the artifact, if they aren't already. This should work just like when you subscribe yourself to a ticket, but for a different user.
created #94: [#4449] Subscribe another user to an artifact (2cp)
Related
Tickets:
#4449Originally by: *anonymous
closed #94, changes are in 42cc_4449
finding an artifact by a URL is a bit tricky, but it works.
subscribe_artifact
if an incomplete URL is given. Or if neighborhood, project, appconf is not found. Since this is only for admins, its not too big of a deal, but I'd still like avoid fatal errors from a form submission. A simple try/catch withlog.warn(..., exc_info=True)
would be fine.__subclasses__()
which finds Artifact of a depth of exactly 2. This should be changed to a recursive function to gather all subclasses (depth 1, 2 and beyond). Add them to aset
so that duplicates are not present (Post
is checked twice in the current implementation). Actually, I think you can call some functions from show_models.py to get this list:for depth, cls in dfs(M.Artifact, build_model_inheritance_graph())
all()
in your for loop.all()
pulls them all into memory, but you're doing a loop, so looping over thefind()
cursor is better.If this isn't fast enough we could add separate input boxes for each kind of artifact
created #104: [#4449] Add error messages and make code better (1cp)
Related
Tickets:
#4449closed #104, pushed changes into 42cc_4449