Skip to content
Permalink
Browse files

Add capabilities for userdb_status

  • Loading branch information...
ibot3 committed Aug 28, 2019
1 parent a3b4233 commit bc70c826d02162ad99379727ffaf53a14a4dddcd
Showing with 7 additions and 5 deletions.
  1. +7 −5 sipa/model/pycroft/user.py
@@ -4,7 +4,7 @@
from sipa.model.user import BaseUser
from sipa.model.finance import BaseFinanceInformation
from sipa.model.fancy_property import active_prop, connection_dependent, \
unsupported_prop, ActiveProperty, UnsupportedProperty
unsupported_prop, ActiveProperty, UnsupportedProperty, Capabilities
from sipa.model.misc import PaymentDetails
from sipa.model.exceptions import UserNotFound, PasswordInvalid, \
MacAlreadyExists, NetworkAccessAlreadyActive
@@ -204,6 +204,8 @@ def hostalias(self):
def userdb_status(self):
status = self.userdb.has_db

capabilities = Capabilities(edit=True, delete=True)

if not self.has_property("userdb"):
return UnsupportedProperty("userdb_status")

@@ -216,14 +218,14 @@ def userdb_status(self):
if status:
return ActiveProperty(name="userdb_status",
value=gettext("Aktiviert"),
style='success')
style='success',
capabilities=capabilities)

return ActiveProperty(name="userdb_status",
value=gettext("Nicht aktiviert"),
empty=True)

empty=True,
capabilities=capabilities)

# userdb_status = userdb_status.fake_setter()

@property
def userdb(self):

0 comments on commit bc70c82

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