Skip to content

Instantly share code, notes, and snippets.

@kmwalsh
Created December 8, 2022 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmwalsh/5bb215d3647b0216b7f281dbe549c8e8 to your computer and use it in GitHub Desktop.
Save kmwalsh/5bb215d3647b0216b7f281dbe549c8e8 to your computer and use it in GitHub Desktop.
https://drewdevault.com/2018/07/02/Email-driven-git.html
Date: Mon, 11 Jun 2018 14:19:22 -0400
From: Drew DeVault <sir@cmpwn.com>
To: Gregory Mullen <omitted>
Subject: Re: [PATCH 2/3 todo] Filter private events from events feed
On 2018-06-11 9:14 AM, Gregory Mullen wrote:
> diff --git a/todosrht/alembic/versions/cb9732f3364c_clear_defaults_from_tickets_to_support_.py b/todosrht/alembic/versions/cb9732f3364c_clear_defaults_from_tickets_to_support_.py
> -%<-
> +class FlagType(types.TypeDecorator):
I think you can safely import the srht FlagType here without implicating
the entire sr.ht database support code
> diff --git a/todosrht/blueprints/html.py b/todosrht/blueprints/html.py
> -%<-
> +def collect_events(target, count):
> + events = []
> + for e in EventNotification.query.filter(EventNotification.user_id == target.id).order_by(EventNotification.created.desc()):
80 cols
I suspect this 'collect_events' function can be done entirely in SQL
without having to process permissions in Python and do several SQL
round-trips
> @html.route("/~<username>")
> def user_GET(username):
> - print(username)
Whoops! Nice catch.
> user = User.query.filter(User.username == username.lower()).first()
> if not user:
> abort(404)
> trackers, _ = get_tracker(username, None)
> # TODO: only show public events (or events the current user can see)
Can remove the comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment