mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-02-24 17:11:18 +00:00
Compare commits
No commits in common. "b27341009e159279ec86b1bab35a7391ed77a0f0" and "391f3bde8fc06be67c35a57b5e5ab31c2f9709d3" have entirely different histories.
b27341009e
...
391f3bde8f
@ -61,12 +61,6 @@ def pre_save_object(sender, instance, **kwargs):
|
||||
# If the field wasn't modified, no need to check the permissions
|
||||
if old_value == new_value:
|
||||
continue
|
||||
|
||||
if app_label == 'auth' and model_name == 'user' and field.name == 'password' and request.user.is_anonymous:
|
||||
# We must ignore password changes from anonymous users since it can be done by people that forgot
|
||||
# their password. We trust password change form.
|
||||
continue
|
||||
|
||||
if not PermissionBackend.check_perm(request, app_label + ".change_" + model_name + "_" + field_name,
|
||||
instance):
|
||||
raise PermissionDenied(
|
||||
|
@ -85,9 +85,6 @@ class UserCreateView(CreateView):
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
# Direct access to validation menu if we have the right to validate it
|
||||
if PermissionBackend.check_perm(self.request, 'auth.view_user', self.object):
|
||||
return reverse_lazy('registration:future_user_detail', args=(self.object.pk,))
|
||||
return reverse_lazy('registration:email_validation_sent')
|
||||
|
||||
|
||||
|
@ -372,11 +372,3 @@ class WEIMembership(Membership):
|
||||
|
||||
soge_credit.update_transactions()
|
||||
soge_credit.save()
|
||||
|
||||
if soge_credit.valid and \
|
||||
soge_credit.credit_transaction.total != sum(tr.total for tr in soge_credit.transactions.all()):
|
||||
# The credit is already validated, but we add a new transaction (eg. for the WEI).
|
||||
# Then we invalidate the transaction, update the credit transaction amount
|
||||
# and re-validate the credit.
|
||||
soge_credit.validate(True)
|
||||
soge_credit.save()
|
||||
|
@ -99,12 +99,9 @@ class WEIRegistrationTable(tables.Table):
|
||||
|
||||
url = reverse_lazy('wei:validate_registration', args=(record.pk,))
|
||||
text = _('Validate')
|
||||
if record.fee > record.user.note.balance and not record.soge_credit:
|
||||
if record.fee > record.user.note.balance:
|
||||
btn_class = 'btn-secondary'
|
||||
tooltip = _("The user does not have enough money.")
|
||||
elif record.first_year and 'selected_bus_pk' not in record.information:
|
||||
btn_class = 'btn-info'
|
||||
tooltip = _("The user is in first year, and the repartition algorithm didn't run.")
|
||||
else:
|
||||
btn_class = 'btn-success'
|
||||
tooltip = _("The user has enough money, you can validate the registration.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user