Fixed account delete brokenness (bug 764843)

This commit is contained in:
Rob Hudson 2012-06-14 12:59:52 -07:00
Родитель 9bae78f89e
Коммит c6edd74496
2 изменённых файлов: 20 добавлений и 17 удалений

Просмотреть файл

@ -275,8 +275,10 @@ class UserProfile(amo.models.OnChangeMixin, amo.models.ModelBase):
use_blacklist=False)
def unrestrict(self):
log.info(u'User (%s: <%s>) is being unrestricted.' % (self, self.email))
GroupUser.objects.filter(user=self, group__rules='Restricted:UGC').delete()
log.info(u'User (%s: <%s>) is being unrestricted.' % (self,
self.email))
GroupUser.objects.filter(user=self,
group__rules='Restricted:UGC').delete()
def generate_confirmationcode(self):
if not self.confirmationcode:
@ -398,6 +400,7 @@ class UserProfile(amo.models.OnChangeMixin, amo.models.ModelBase):
# Circular import
from amo.utils import memoize
from market.models import AddonPurchase
@memoize(prefix='users:purchase-ids')
def ids(pk):
return (AddonPurchase.objects.filter(user=pk)

Просмотреть файл

@ -5,21 +5,21 @@
if (!$('body.reviews').length) {
return;
}
initCharCount();
// Hijack <select> with stars.
$('select[name="rating"]').ratingwidget();
// Handle review deletions.
$('.delete').on('click', _pd(function() {
var $this = $(this),
$r = $this.closest('.review');
$r.addClass('deleting');
$.post($this.attr('href')).success(function() {
$r.addClass('deleted');
});
}));
}, 0);
initCharCount();
// Hijack <select> with stars.
$('select[name="rating"]').ratingwidget();
// Handle review deletions.
$('.delete').on('click', _pd(function() {
var $this = $(this),
$r = $this.closest('.review');
$r.addClass('deleting');
$.post($this.attr('href')).success(function() {
$r.addClass('deleted');
});
}));
});
})();