-
-
Save amiraliakbari/0e556f1f8a7810415621 to your computer and use it in GitHub Desktop.
Refactoring Exercise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_page_from_queue(): | |
pages = Page.objects.filter(username=q_key) | |
if pages: | |
page = pages[0] | |
setattr(page, 'priority', q_value) | |
page.save() | |
else: | |
pq = PageQueue(username=q_key, priority=q_value) | |
pq.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment