Changeset - 493646d3146f
[Not reviewed]
beta
0 3 1
Marcin Kuzminski - 13 years ago 2012-09-04 02:18:59
marcin@python-works.com
Nicer email notifications about pull-request
4 files changed with 42 insertions and 11 deletions:
0 comments (0 inline, 0 general)
docs/changelog.rst
Show inline comments
 
@@ -18,15 +18,17 @@ news
 
  empty data 
 
- modified_on column saves repository update and it's going to be used
 
  later for light version of main page ref #500
 
- pull request notifications send much nicer emails with details about pull
 
  request
 

	
 
fixes
 
+++++
 

	
 
- fixed migrations of permissions that can lead to inconsistency.
 
  Some users sent feedback that after upgrading from older versions issues with updating
 
  default permissions occured. RhodeCode detects that now and resets default user
 
  permission to initial state if there is a need for that. Also forces users to set
 
  the default value for new forking permission. 
 
  Some users sent feedback that after upgrading from older versions issues 
 
  with updating default permissions occurred. RhodeCode detects that now and
 
  resets default user permission to initial state if there is a need for that.
 
  Also forces users to set the default value for new forking permission. 
 

	
 

	
 
1.4.0 (**2012-09-03**)
rhodecode/model/notification.py
Show inline comments
 
@@ -255,7 +255,8 @@ class EmailNotificationModel(BaseModel):
 
         self.TYPE_CHANGESET_COMMENT: 'email_templates/changeset_comment.html',
 
         self.TYPE_PASSWORD_RESET: 'email_templates/password_reset.html',
 
         self.TYPE_REGISTRATION: 'email_templates/registration.html',
 
         self.TYPE_DEFAULT: 'email_templates/default.html'
 
         self.TYPE_DEFAULT: 'email_templates/default.html',
 
         self.TYPE_PULL_REQUEST: 'email_templates/pull_request.html',
 
        }
 

	
 
    def get_email_tmpl(self, type_, **kwargs):
rhodecode/model/pull_request.py
Show inline comments
 
@@ -79,22 +79,30 @@ class PullRequestModel(BaseModel):
 
        #notification to reviewers
 
        notif = NotificationModel()
 

	
 
        pr_url = h.url('pullrequest_show', repo_name=other_repo.repo_name,
 
                       pull_request_id=new.pull_request_id,
 
                       qualified=True,
 
        )
 
        subject = safe_unicode(
 
            h.link_to(
 
              _('%(user)s wants you to review pull request #%(pr_id)s') % \
 
                {'user': created_by_user.username,
 
                 'pr_id': new.pull_request_id},
 
              h.url('pullrequest_show', repo_name=other_repo.repo_name,
 
                    pull_request_id=new.pull_request_id,
 
                    qualified=True,
 
              )
 
                pr_url
 
            )
 
        )
 
        body = description
 
        kwargs = {
 
            'pr_title': title,
 
            'pr_user_created': h.person(created_by_user.email),
 
            'pr_repo_url': h.url('summary_home', repo_name=other_repo.repo_name,
 
                                 qualified=True,),
 
            'pr_url': pr_url,
 
            'pr_revisions': revisions
 
        }
 
        notif.create(created_by=created_by_user, subject=subject, body=body,
 
                     recipients=reviewers,
 
                     type_=Notification.TYPE_PULL_REQUEST,)
 

	
 
                     type_=Notification.TYPE_PULL_REQUEST, email_kwargs=kwargs)
 
        return new
 

	
 
    def update_reviewers(self, pull_request, reviewers_ids):
rhodecode/templates/email_templates/pull_request.html
Show inline comments
 
new file 100644
 
## -*- coding: utf-8 -*-
 
<%inherit file="main.html"/>
 
            
 
User <b>${pr_user_created}</b> opened pull request for repository 
 
${pr_repo_url} and wants you to review changes.
 

	
 
<div>title: ${pr_title}</div>
 
<div>description:</div>
 
<p>
 
${body}
 
</p>
 

	
 
<div>revisions for reviewing</div>
 
<ul>
 
%for r in pr_revisions:
 
    <li>${r}</li>
 
%endfor
 
</ul>
 

	
 
View this pull request here: ${pr_url}
0 comments (0 inline, 0 general)