Not enough values to unpack (expected 2, got 1)
See original GitHub issueHello! I faced with this problem when I try to run command python manage.py qcluster:
[Q] INFO Q Cluster-21177 starting.
[Q] INFO Process-1:1 ready for work at 21181
[Q] INFO Process-1:2 ready for work at 21182
[Q] INFO Process-1:3 ready for work at 21183
[Q] INFO Process-1:4 ready for work at 21184
[Q] INFO Process-1:5 monitoring at 21185
[Q] INFO Process-1 guarding cluster at 21180
[Q] INFO Process-1:6 pushing tasks at 21186
[Q] INFO Q Cluster-21177 running.
[Q] INFO Enqueued 2
[Q] INFO Process-1 created a task from schedule [check_achievements_monthly]
[Q] INFO Process-1:1 processing [two-nineteen-may-pasta]
[Q] ERROR Failed [two-nineteen-may-pasta] - not enough values to unpack (expected 2, got 1)
I use Python 3.7, Django 2.0.7
from datetime import datetime
from django.contrib.auth.models import User
from django_q.tasks import schedule
from pytz import timezone
from achievements.models import Achievement, UserAchievement
def check_ach(*args, **kwargs):
for achievement in Achievement.objects.filter(period=args[0]):
for user in User.objects.all():
try:
user_achievement = achievement.users_achievements.get(user=user)
except UserAchievement.DoesNotExist:
user_achievement = None
if user_achievement and user_achievement.max_amount_reached:
continue # user already has maximal amount of that achievement - skip
if achievement.is_earned(user):
UserAchievement.objects.create(achievement=achievement, user=user)
schedule(check_ach,'MONTHLY', name='check_achievements_monthly', schedule_type='M', next_run=datetime.now().astimezone(timezone('Europe/Kiev')))
Can you help me with this issue?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:7
Top Results From Across the Web
Python - How to fix “ValueError: not enough values to unpack ...
Python - How to fix “ValueError: not enough values to unpack (expected 2, got 1)” [closed] ; 1. Kindly add script which invokes...
Read more >ValueError: not enough values to unpack (expected 2, got 1)
During a multiple value assignment, the ValueError: not enough values to unpack occurs when either you have fewer objects to assign than variables,...
Read more >ValueError: not enough values to unpack (expected 2, got 1)
ValueError: not enough values to unpack ( expected 2, got 1 ) || Value Error in Python The Python ValueError is an exception...
Read more >Related error not enough values to unpack (expected 2, got 1)
This error caused by the mismatch between the number of values returned and the number of variables in the assignment statement. This error ......
Read more >ValueError: not enough values to unpack (expected 2, got 1 ...
Hi. I was trying to use the EqOddsPostprocessing algorithm and I received the error referenced when calling the predict method. Going into this,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mm-matthias @bronte2k7 @nastyaDjo I fixed it: in task pass not function instance, but path to it as
str
. For example:'users.emails.send_email_message'
instead ofsend_email_message
I see this issue when requeing a failed task via the admin panel.