mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-06 23:26:19 +01:00
editorconfig applied
This commit is contained in:
@@ -6,10 +6,12 @@ from . import urls
|
||||
|
||||
class TimerboardMenu(MenuItemHook):
|
||||
def __init__(self):
|
||||
MenuItemHook.__init__(self, 'Structure Timers',
|
||||
'far fa-clock fa-fw',
|
||||
'timerboard:view',
|
||||
navactive=['timerboard:'])
|
||||
MenuItemHook.__init__(
|
||||
self, 'Structure Timers',
|
||||
'far fa-clock fa-fw',
|
||||
'timerboard:view',
|
||||
navactive=['timerboard:']
|
||||
)
|
||||
|
||||
def render(self, request):
|
||||
if request.user.has_perm('auth.timer_view'):
|
||||
|
||||
@@ -33,27 +33,27 @@ class TimerForm(forms.ModelForm):
|
||||
super(TimerForm, self).__init__(*args, **kwargs)
|
||||
|
||||
structure_choices = [('POCO', 'POCO'),
|
||||
('I-HUB', 'I-HUB'),
|
||||
('TCU', 'TCU'),
|
||||
('POS[S]', 'POS[S]'),
|
||||
('POS[M]', 'POS[M]'),
|
||||
('POS[L]', 'POS[L]'),
|
||||
('Astrahus', 'Astrahus'),
|
||||
('Fortizar', 'Fortizar'),
|
||||
('Keepstar', 'Keepstar'),
|
||||
('Raitaru', 'Raitaru'),
|
||||
('Azbel', 'Azbel'),
|
||||
('Sotiyo', 'Sotiyo'),
|
||||
('Athanor', 'Athanor'),
|
||||
('Tatara', 'Tatara'),
|
||||
('Pharolux Cyno Beacon', 'Pharolux Cyno Beacon'),
|
||||
('Tenebrex Cyno Jammer', 'Tenebrex Cyno Jammer'),
|
||||
('Ansiblex Jump Gate', 'Ansiblex Jump Gate'),
|
||||
('Moon Mining Cycle', 'Moon Mining Cycle'),
|
||||
(_('Other'), _('Other'))]
|
||||
('I-HUB', 'I-HUB'),
|
||||
('TCU', 'TCU'),
|
||||
('POS[S]', 'POS[S]'),
|
||||
('POS[M]', 'POS[M]'),
|
||||
('POS[L]', 'POS[L]'),
|
||||
('Astrahus', 'Astrahus'),
|
||||
('Fortizar', 'Fortizar'),
|
||||
('Keepstar', 'Keepstar'),
|
||||
('Raitaru', 'Raitaru'),
|
||||
('Azbel', 'Azbel'),
|
||||
('Sotiyo', 'Sotiyo'),
|
||||
('Athanor', 'Athanor'),
|
||||
('Tatara', 'Tatara'),
|
||||
('Pharolux Cyno Beacon', 'Pharolux Cyno Beacon'),
|
||||
('Tenebrex Cyno Jammer', 'Tenebrex Cyno Jammer'),
|
||||
('Ansiblex Jump Gate', 'Ansiblex Jump Gate'),
|
||||
('Moon Mining Cycle', 'Moon Mining Cycle'),
|
||||
(_('Other'), _('Other'))]
|
||||
objective_choices = [('Friendly', _('Friendly')),
|
||||
('Hostile', _('Hostile')),
|
||||
('Neutral', _('Neutral'))]
|
||||
('Hostile', _('Hostile')),
|
||||
('Neutral', _('Neutral'))]
|
||||
|
||||
details = forms.CharField(max_length=254, required=True, label=_('Details'))
|
||||
system = forms.CharField(max_length=254, required=True, label=_("System"))
|
||||
@@ -64,7 +64,7 @@ class TimerForm(forms.ModelForm):
|
||||
hours_left = forms.IntegerField(required=True, label=_("Hours Remaining"),
|
||||
validators=[MinValueValidator(0), MaxValueValidator(23)])
|
||||
minutes_left = forms.IntegerField(required=True, label=_("Minutes Remaining"),
|
||||
validators=[MinValueValidator(0), MaxValueValidator(59)])
|
||||
validators=[MinValueValidator(0), MaxValueValidator(59)])
|
||||
important = forms.BooleanField(label=_("Important"), required=False)
|
||||
corp_timer = forms.BooleanField(label=_("Corp-Restricted"), required=False)
|
||||
|
||||
@@ -75,10 +75,10 @@ class TimerForm(forms.ModelForm):
|
||||
character = self.user.profile.main_character
|
||||
corporation = character.corporation
|
||||
logger.debug("Determined timer save request on behalf "
|
||||
"of character {} corporation {}".format(character, corporation))
|
||||
"of character {} corporation {}".format(character, corporation))
|
||||
# calculate future time
|
||||
future_time = datetime.timedelta(days=self.cleaned_data['days_left'], hours=self.cleaned_data['hours_left'],
|
||||
minutes=self.cleaned_data['minutes_left'])
|
||||
minutes=self.cleaned_data['minutes_left'])
|
||||
current_time = timezone.now()
|
||||
eve_time = current_time + future_time
|
||||
logger.debug(
|
||||
|
||||
@@ -18,9 +18,9 @@ class TimerboardViewsTestCase(WebTest):
|
||||
|
||||
def setUp(self):
|
||||
corp = EveCorporationInfo.objects.create(corporation_id='2345', corporation_name='test corp',
|
||||
corporation_ticker='testc', member_count=24)
|
||||
corporation_ticker='testc', member_count=24)
|
||||
other_corp = EveCorporationInfo.objects.create(corporation_id='9345', corporation_name='other test corp',
|
||||
corporation_ticker='testd', member_count=1)
|
||||
corporation_ticker='testd', member_count=1)
|
||||
self.user = AuthUtils.create_user('test_user')
|
||||
AuthUtils.add_main_character(self.user, 'test character', '1234', '2345', 'test corp', 'testc')
|
||||
self.user = User.objects.get_by_natural_key('test_user')
|
||||
|
||||
@@ -71,8 +71,7 @@ class AddTimerView(TimerManagementView, AddUpdateMixin, CreateView):
|
||||
result = super(AddTimerView, self).form_valid(form)
|
||||
timer = self.object
|
||||
logger.info("Created new timer in {} at {} by user {}".format(timer.system, timer.eve_time, self.request.user))
|
||||
messages.success(self.request, _('Added new timer in %(system)s at %(time)s.') % {"system": timer.system,
|
||||
"time": timer.eve_time})
|
||||
messages.success(self.request, _('Added new timer in %(system)s at %(time)s.') % {"system": timer.system, "time": timer.eve_time})
|
||||
return result
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user