Skip to content
Permalink
Browse files

Clarify purpose of double getattr

  • Loading branch information...
lukasjuhrich committed Sep 15, 2019
1 parent 39aea31 commit b0fe7057dba4681e8650dfd50d32b57ac504b959
Showing with 3 additions and 1 deletion.
  1. +3 −1 sipa/blueprints/usersuite.py
@@ -17,6 +17,7 @@
ChangeUseCacheForm, PaymentForm, ActivateNetworkAccessForm, TerminateMembershipForm, \
TerminateMembershipConfirmForm, ContinueMembershipForm
from sipa.mail import send_usersuite_contact_mail
from sipa.model.fancy_property import ActiveProperty
from sipa.utils import password_changeable
from sipa.model.exceptions import DBQueryEmpty, LDAPConnectionError, \
PasswordInvalid, UserNotFound, MacAlreadyExists, TerminationNotPossible, UnknownError, \
@@ -29,7 +30,8 @@


def capability_or_403(active_property, capability):
if not getattr(getattr(current_user, active_property).capabilities, capability):
prop: ActiveProperty = getattr(current_user, active_property)
if not getattr(prop.capabilities, capability):
abort(403)


0 comments on commit b0fe705

Please sign in to comment.
You can’t perform that action at this time.