import os

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()

print("NEW WOZZT TEST")

from museum_site.wozzt_queue import WoZZT_Queue  # noqa: E402


def main():
    entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]

    entry.send_tweet()
    entry.delete_image()
    entry.delete()
    print("Well that was easy.")


if __name__ == "__main__":
    main()

import os

import django

from datetime import datetime

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()

from museum_site.wozzt_queue import WoZZT_Queue  # noqa: E402


def main():
    now = datetime.now()

    if now.weekday() == 1:  # Tuesday
        entry = WoZZT_Queue.objects.filter(category="tuesday")
    else:
        entry = WoZZT_Queue.objects.all(category="wozzt")

    entry = entry.order_by("-priority", "id")[0]
    entry.send_tweet()
    entry.delete_image()
    entry.delete()
    print("Done.")


if __name__ == "__main__":
    main()

Use Tuesday branch on Tuesdays
Use Tuesday branch on Tuesdays

  import os
  
  import django
  
+ from datetime import datetime
+ 
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
  django.setup()
- 
- print("NEW WOZZT TEST")
  
  from museum_site.wozzt_queue import WoZZT_Queue  # noqa: E402
  
  
  def main():
-     entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]
+     now = datetime.now()
  
+     if now.weekday() == 1:  # Tuesday
+         entry = WoZZT_Queue.objects.filter(category="tuesday")
+     else:
+         entry = WoZZT_Queue.objects.all(category="wozzt")
+ 
+     entry = entry.order_by("-priority", "id")[0]
      entry.send_tweet()
      entry.delete_image()
      entry.delete()
-     print("Well that was easy.")
+     print("Done.")
  
  
  if __name__ == "__main__":
      main()
  
Use Tuesday branch on Tuesdays
## Code Before:
import os

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()

print("NEW WOZZT TEST")

from museum_site.wozzt_queue import WoZZT_Queue  # noqa: E402


def main():
    entry = WoZZT_Queue.objects.all().order_by("-priority", "id")[0]

    entry.send_tweet()
    entry.delete_image()
    entry.delete()
    print("Well that was easy.")


if __name__ == "__main__":
    main()

## Instruction:
Use Tuesday branch on Tuesdays
## Code After:
import os

import django

from datetime import datetime

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()

from museum_site.wozzt_queue import WoZZT_Queue  # noqa: E402


def main():
    now = datetime.now()

    if now.weekday() == 1:  # Tuesday
        entry = WoZZT_Queue.objects.filter(category="tuesday")
    else:
        entry = WoZZT_Queue.objects.all(category="wozzt")

    entry = entry.order_by("-priority", "id")[0]
    entry.send_tweet()
    entry.delete_image()
    entry.delete()
    print("Done.")


if __name__ == "__main__":
    main()
