@events.route('/<int:event_id>/role-invite/decline/<hash>', methods=['GET', 'POST'])
def user_role_invite_decline(event_id, hash):
 event = DataGetter.get_event(event_id)
 user = current_user
 role_invite = DataGetter.get_event_role_invite(event.id, hash, email=user.email)
 if role_invite:
  if role_invite.has_expired():
   delete_from_db(role_invite, 'Deleted RoleInvite')
   flash('Sorry, the invitation link has expired.', 'error')
   return redirect(url_for('.details_view', event_id=event.id))
  DataManager.decline_role_invite(role_invite)
  flash('You have declined the role invite.')
  return redirect(url_for('.details_view', event_id=event.id))
 else:
  abort(404)

@ events . route ( '/<int:event_id>/role-invite/decline/<hash>' , methods = [ 'GET' , 'POST' ] ) def user_role_invite_decline ( event_id , hash ) : event = DataGetter . get_event ( event_id ) user = current_user role_invite = DataGetter . get_event_role_invite ( event . id , hash , email = user . email ) if role_invite : if role_invite . has_expired ( ) : delete_from_db ( role_invite , 'Deleted RoleInvite' ) flash ( 'Sorry, the invitation link has expired.' , 'error' ) return redirect ( url_for ( '.details_view' , event_id = event . id ) ) DataManager . decline_role_invite ( role_invite ) flash ( 'You have declined the role invite.' ) return redirect ( url_for ( '.details_view' , event_id = event . id ) ) else : abort ( 404 )
decline user-role invite for the event .