| LEFT | RIGHT |
|---|---|
| 1 # Copyright 2008 Google Inc. | 1 # Copyright 2008 Google Inc. |
| 2 # | 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
| 6 # | 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # | 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 168 matching lines...) Show 10 above Show 10 below | |
| 179 max_length=1000, | 179 max_length=1000, |
| 180 widget=forms.TextInput(attrs={'size': 60})) | 180 widget=forms.TextInput(attrs={'size': 60})) |
| 181 send_mail = forms.BooleanField() | 181 send_mail = forms.BooleanField() |
| 182 message = forms.CharField(required=False, | 182 message = forms.CharField(required=False, |
| 183 max_length=10000, | 183 max_length=10000, |
| 184 widget=forms.Textarea(attrs={'cols': 60})) | 184 widget=forms.Textarea(attrs={'cols': 60})) |
| 185 | 185 |
| 186 | 186 |
| 187 class MiniPublishForm(forms.Form): | 187 class MiniPublishForm(forms.Form): |
| 188 | 188 |
| 189 send_mail = forms.BooleanField() | |
|
GvR
2008/05/11 23:27:41
The order of the fields should be the same as in P
| |
| 189 reviewers = forms.CharField(required=False, | 190 reviewers = forms.CharField(required=False, |
| 190 max_length=1000, | 191 max_length=1000, |
| 191 widget=forms.TextInput(attrs={'size': 60})) | 192 widget=forms.TextInput(attrs={'size': 60})) |
| 192 send_mail = forms.BooleanField() | |
| 193 message = forms.CharField(required=False, | 193 message = forms.CharField(required=False, |
| 194 max_length=10000, | 194 max_length=10000, |
| 195 widget=forms.Textarea(attrs={'cols': 60})) | 195 widget=forms.Textarea(attrs={'cols': 60})) |
| 196 | 196 |
| 197 | 197 |
| 198 class SettingsForm(forms.Form): | 198 class SettingsForm(forms.Form): |
| 199 | 199 |
| 200 nickname = forms.CharField(max_length=30) | 200 nickname = forms.CharField(max_length=30) |
| 201 | 201 |
| 202 | 202 |
| (...skipping 800 matching lines...) Show 10 above Show 10 below | |
| 1003 if comments: | 1003 if comments: |
| 1004 logging.warn('Publishing %d comments', len(comments)) | 1004 logging.warn('Publishing %d comments', len(comments)) |
| 1005 # Decide who should receive mail | 1005 # Decide who should receive mail |
| 1006 my_email = db.Email(request.user.email()) | 1006 my_email = db.Email(request.user.email()) |
| 1007 addressees = [db.Email(issue.owner.email())] + issue.reviewers | 1007 addressees = [db.Email(issue.owner.email())] + issue.reviewers |
| 1008 if my_email in addressees: | 1008 if my_email in addressees: |
| 1009 everyone = addressees[:] | 1009 everyone = addressees[:] |
| 1010 if len(addressees) > 1: # Keep it if sending only to yourself | 1010 if len(addressees) > 1: # Keep it if sending only to yourself |
| 1011 addressees.remove(my_email) | 1011 addressees.remove(my_email) |
| 1012 else: | 1012 else: |
| 1013 everyone = addressees | 1013 everyone = addressees + [my_email] |
|
GvR
2008/05/11 23:27:41
What would you think of *not* adding my_email in t
jiayao
2008/05/12 09:36:35
Make sense. It would be confusing if this person r
| |
| 1014 details = _get_draft_details(request, comments) | 1014 details = _get_draft_details(request, comments) |
| 1015 text = ((message.strip() + '\n\n' + details.strip())).strip() | 1015 text = ((message.strip() + '\n\n' + details.strip())).strip() |
| 1016 msg = models.Message(issue=issue, | 1016 msg = models.Message(issue=issue, |
| 1017 subject=issue.subject, | 1017 subject=issue.subject, |
| 1018 sender=my_email, | 1018 sender=my_email, |
| 1019 recipients=everyone, | 1019 recipients=everyone, |
| 1020 text=db.Text(text), | 1020 text=db.Text(text), |
| 1021 parent=issue) | 1021 parent=issue) |
| 1022 tbd.append(msg) | 1022 tbd.append(msg) |
| 1023 | 1023 |
| (...skipping 220 matching lines...) Show 10 above Show 10 below | |
| 1244 else: | 1244 else: |
| 1245 accounts = models.Account.get_accounts_for_nickname(nickname) | 1245 accounts = models.Account.get_accounts_for_nickname(nickname) |
| 1246 if nickname != account.nickname and accounts: | 1246 if nickname != account.nickname and accounts: |
| 1247 form.errors['nickname'] = ['This nickname is already in use.'] | 1247 form.errors['nickname'] = ['This nickname is already in use.'] |
| 1248 else: | 1248 else: |
| 1249 account.nickname = nickname | 1249 account.nickname = nickname |
| 1250 account.put() | 1250 account.put() |
| 1251 if not form.is_valid(): | 1251 if not form.is_valid(): |
| 1252 return respond(request, 'settings.html', {'form': form}) | 1252 return respond(request, 'settings.html', {'form': form}) |
| 1253 return HttpResponseRedirect('/settings') | 1253 return HttpResponseRedirect('/settings') |
| LEFT | RIGHT |