Fixed account delete brokenness (bug 764843)
This commit is contained in:
Родитель
9bae78f89e
Коммит
c6edd74496
|
@ -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');
|
||||
});
|
||||
}));
|
||||
});
|
||||
})();
|
||||
|
|
Загрузка…
Ссылка в новой задаче