I reworked some Agilo-AccountManager related features:
1. Delete user (not remove user) deletes the user via
acct_mgr::delete_user as well
2. Fixed grant permission bug that raises exception if user with same
credentials is present and you try to create the user again.
3. Do not assign to team_member.full_name team_member.email since it
creates the user in the DB and acct_mgr::has_user will always return
true.
4. Since I am using LDAP to get user info, I made the full name /
email fields as read only after the account is created. I have
acct_mgr patches for those interested (it works with windows AD as
well).

Here is the patch:

--- agilo/admin/team.py (revision 578)
+++ agilo/admin/team.py (working copy)
@@ -56,9 +56,14 @@
                     member.save()
                 else:
                     member.delete()
+                    # Delete this user from the system
+                    usr_mgr = UserManager(self.env)
+                    usr_mgr.delete_team_member(member_name)
+
             # removing members will reduce the capacity, hence the
ideal
             # burndown must be recalculated
             ChartGenerator(self.env).invalidate_cache()
+
             return req.redirect(req.href.admin(cat, page, name))


@@ -146,8 +151,10 @@
         team = Team(self.env, name=name)
         team_member = TeamMember(self.env, team=team, name=req.args
['team_member'])
         team_member.description = req.args.get('member_description')
-        team_member.full_name = req.args.get('member_full_name', '')
-        team_member.email = req.args.get('member_email', '')
+        # The following lines creats the email/name entries in DB.
+        # has_user always returns true in this situation
+        #team_member.full_name = req.args.get('member_full_name', '')
+        #team_member.email = req.args.get('member_email', '')
         usr_mgr = UserManager(self.env)
         act_create = req.args.get('createUser_ok')
         act_add    = req.args.get('add')

Index: agilo/templates/agilo_admin_team.html
===================================================================
--- agilo/templates/agilo_admin_team.html       (revision 578)
+++ agilo/templates/agilo_admin_team.html       (working copy)
@@ -70,7 +70,7 @@
                <table class="listing" id="complist">
                   <thead>
                     <tr>
-                    <th>Delete?</th>
+                    <th>Delete User?</th>
                        <th>Name</th>
                                <th>Description</th>
                                <th>Weekly capacity</th>
@@ -98,22 +98,22 @@
         <fieldset>
           <legend>Team Member '${team_member.name}'</legend>
           <div class="field">
-            <label>Name
+            <label>Name:
               <span style="font-weight:bold;">${team_member.name}</
span>
             </label>
           </div>
           <div class="field">
-            <label>Full Name
-              <input name="member_full_name" value="$
{team_member.full_name}" />
+            <label>Full Name:
+                <span style="font-weight:bold;">$
{team_member.full_name}</span>
             </label>
           </div>
           <div class="field">
-            <label>Email
-              <input name="member_email" value="$
{team_member.email}" />
+            <label>Email:
+                <span style="font-weight:bold;">${team_member.email}</
span>
             </label>
           </div>
           <div class="field">
-            <label>Description
+            <label>Description:
               <input name="member_description" value="$
{team_member.description}" />
             </label>
           </div>
@@ -182,11 +182,7 @@
       <form py:when="'create_user_confirm'" class="mod" id="modcomp"
method="post">
         <fieldset>
           <legend>New user creation </legend>
-            <label>Do you want to create this user and add him to the
team ?<br /><br />
-              Name: <br />
-              <span style="font-weight:bold;">${user_name}</span>
<br />
-              Password: <br />
-              <span style="font-weight:bold;">${user_name}</span>
<br />
+          <label>Do you want to create the user: <b>${user_name}</b>
and add him to the team ?
             </label>
           <div class="buttons">
             <input type="hidden" name="team_member" value="$
{user_name}" />
Index: agilo/utils/usermanager.py
===================================================================
--- agilo/utils/usermanager.py  (revision 578)
+++ agilo/utils/usermanager.py  (working copy)
@@ -47,12 +47,16 @@
         if not password:
             password = user
         self.accMgr.set_password(user, password)
-        self.perm.grant_permission(user, Role.TEAM_MEMBER )
+        self.set_user_as_team_member(user)
+        #self.perm.grant_permission(user, Role.TEAM_MEMBER )

     def set_user_as_team_member(self, user):
         if (user, Role.TEAM_MEMBER ) not in
self.perm.get_all_permissions():
             self.perm.grant_permission(user, Role.TEAM_MEMBER )

+    def delete_team_member(self, user):
+        self.accMgr.delete_user(user)
+
 def unittest_mock_set_accountManagerClass(accountManagerClass):
     global AccountManager
     AccountManager = accountManagerClass



On Apr 24, 8:17 am, Felix Schwarz <[email protected]> wrote:
> vy_agile schrieb:
>
> > I'm using original VM image, when creating own project and creating
> > users everything is ok: created users can explore project according to
> > permissions but when adding user to the team permissions fails
> > (crashes) - on the top of main "window" showed frame with text and hex
> > address (python core message?) and below it showed frame that required
> > according permission.
>
> If i understood you correctly, there is an error message shown. This
> message would be very helpful to us.
>
> If you see the error, is there a button like 'create bug report'? If you
> press this button, you will see the ticket entry form at trac.edgewall.org.
> PLEASE DO NOT ADD THE BUG AT trac.edgewall.org!
> But please copy&paste the description of the ticket into a mail and send
> it to this mailing list. The stack trace there will contain all
> necessary information.
>
> If you don't see this 'create bug report' button, please post the exact
> error message and explain what you did (which page, what data did you
> enter in the forms).
>
> fs
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Agilo for Scrum" group. This group is moderated by agile42 GmbH 
http://www.agile42.com and is focused in supporting Agilo for Scrum users.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/agilo?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to