#!/usr/bin/env python from sentry.runner import configure configure() import argparse def main(username, newsletter_consent_prompt=None): from sentry.users.models.user import User user = User.objects.get(username__iexact=username) if newsletter_consent_prompt is not None: user.flags.newsletter_consent_prompt = newsletter_consent_prompt user.save() if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("username", default=None, nargs="?") parser.add_argument( "--newsletter-consent-prompt", dest="newsletter_consent_prompt", action="store_true" ) parser.add_argument( "--no-newsletter-consent-prompt", dest="newsletter_consent_prompt", action="store_false" ) args = parser.parse_args() main(username=args.username, newsletter_consent_prompt=args.newsletter_consent_prompt)