Ejemplo n.º 1
0
 def get_for_user(self, user):
     states = self.available_to_user(user)
     if states.exists():
         return states[0]
     else:
         from allianceauth.authentication.models import get_guest_state
         return get_guest_state()
Ejemplo n.º 2
0
 def get_for_character(self, character):
     states = self.get_queryset().available_to_character(character)
     if states.exists():
         return states[0]
     else:
         from allianceauth.authentication.models import get_guest_state
         return get_guest_state()
Ejemplo n.º 3
0
 def get_for_character(self, character):
     states = self.get_queryset().available_to_character(character)
     if states.exists():
         return states[0]
     else:
         from allianceauth.authentication.models import get_guest_state
         return get_guest_state()
Ejemplo n.º 4
0
 def get_for_user(self, user):
     states = self.available_to_user(user)
     if states.exists():
         return states[0]
     else:
         from allianceauth.authentication.models import get_guest_state
         return get_guest_state()
Ejemplo n.º 5
0
 def get_fieldsets(self, request, obj=None):
     if obj == get_guest_state():
         return (
             (None, {
                 'fields': ('permissions', 'priority'),
             }),
         )
     return super(StateAdmin, self).get_fieldsets(request, obj=obj)
Ejemplo n.º 6
0
class PseudoProfile:
    main_character: EveCharacter
    state: State = get_guest_state()
Ejemplo n.º 7
0
 def has_delete_permission(self, request, obj=None):
     if obj == get_guest_state():
         return False
     return super(StateAdmin, self).has_delete_permission(request, obj=obj)
Ejemplo n.º 8
0
 def get_fieldsets(self, request, obj=None):
     if obj == get_guest_state():
         return ((None, {
             'fields': ('permissions', 'priority'),
         }), )
     return super(StateAdmin, self).get_fieldsets(request, obj=obj)
Ejemplo n.º 9
0
 def has_delete_permission(self, request, obj=None):
     if obj == get_guest_state():
         return False
     return super(StateAdmin, self).has_delete_permission(request, obj=obj)
Ejemplo n.º 10
0
 def get_guest_state(cls):
     cls.disconnect_signals()
     state = get_guest_state()
     cls.connect_signals()
     return state
Ejemplo n.º 11
0
 def get_guest_state(cls):
     cls.disconnect_signals()
     state = get_guest_state()
     cls.connect_signals()
     return state
Ejemplo n.º 12
0
 def __init__(self, main):
     self.main_character = main
     self.state = get_guest_state()