mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
python: Reformat with Black, except quotes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
5028c081cb
commit
11741543da
@@ -14,16 +14,19 @@ class Command(ZulipBaseCommand):
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
default_cutoff = time.time() - 60 * 60 * 24 * 30 # 30 days.
|
||||
self.add_realm_args(parser, True)
|
||||
parser.add_argument('--since',
|
||||
type=int,
|
||||
default=default_cutoff,
|
||||
help='The time in epoch since from which to start the dump.')
|
||||
parser.add_argument(
|
||||
'--since',
|
||||
type=int,
|
||||
default=default_cutoff,
|
||||
help='The time in epoch since from which to start the dump.',
|
||||
)
|
||||
|
||||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
realm = self.get_realm(options)
|
||||
streams = Stream.objects.filter(realm=realm, invite_only=False)
|
||||
recipients = Recipient.objects.filter(
|
||||
type=Recipient.STREAM, type_id__in=[stream.id for stream in streams])
|
||||
type=Recipient.STREAM, type_id__in=[stream.id for stream in streams]
|
||||
)
|
||||
cutoff = datetime.datetime.fromtimestamp(options["since"], tz=datetime.timezone.utc)
|
||||
messages = Message.objects.filter(date_sent__gt=cutoff, recipient__in=recipients)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user