Skip to content

Commit

Permalink
Fix compatibility with Coaster (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jace authored Apr 10, 2024
1 parent b7aea60 commit a5ee5e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions get-twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import tweepy

from hasjob import app, init_for
from hasjob import app

init_for('dev')
auth = tweepy.OAuthHandler(
app.config['TWITTER_CONSUMER_KEY'], app.config['TWITTER_CONSUMER_SECRET']
)
Expand Down
5 changes: 3 additions & 2 deletions hasjob/views/admin_filterset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@


@route('/f')
class AdminFiltersetView(UrlForView, ModelView):
model = Filterset
class AdminFiltersetView(UrlForView, ModelView[Filterset]):

route_model_map = {'name': 'name'}

def loader(self, name=None):
if name:
Expand Down
6 changes: 2 additions & 4 deletions hasjob/views/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,8 @@ def wrapper(self, *args, **kwargs):


@route('/admin/campaign/<campaign>')
class AdminCampaignView(UrlForView, InstanceLoader, ModelView):
class AdminCampaignView(UrlForView, InstanceLoader, ModelView[Campaign]):
__decorators__ = [lastuser.requires_permission('siteadmin'), campaign_current_tab]
model = Campaign
route_model_map = {'campaign': 'name'}

@classmethodproperty
Expand Down Expand Up @@ -410,12 +409,11 @@ def view_counts(self):


@route('/admin/campaign/<campaign>/<action>')
class AdminCampaignActionView(UrlForView, InstanceLoader, ModelView):
class AdminCampaignActionView(UrlForView, InstanceLoader, ModelView[CampaignAction]):
__decorators__ = [
lastuser.requires_permission('siteadmin'),
campaign_action_current_tab,
]
model = CampaignAction
route_model_map = {'action': 'name', 'campaign': 'parent.name'}

@classmethodproperty
Expand Down

0 comments on commit a5ee5e9

Please sign in to comment.