Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with Coaster #762

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading