passing tests - teams can be created
This commit is contained in:
@@ -928,6 +928,23 @@ def iscoachmember(user):
|
||||
|
||||
return result
|
||||
|
||||
def cancreateteam(user):
|
||||
if user.is_anonymous():
|
||||
return False
|
||||
|
||||
try:
|
||||
r = Rower.objects.get(user=user)
|
||||
except Rower.DoesNotExist:
|
||||
r = Rower(user=user)
|
||||
r.save()
|
||||
|
||||
if user.is_authenticated() and (r.rowerplan=='coach'):
|
||||
return True
|
||||
elif user.is_athenticated() and r.rowerplan in ['plan','pro']:
|
||||
ts = Team.objects.filter(manager=user)
|
||||
if len(otherteams) >= 1:
|
||||
return False
|
||||
|
||||
# Check if a user can create planned sessions
|
||||
def hasplannedsessions(user):
|
||||
if not user.is_anonymous():
|
||||
|
||||
Reference in New Issue
Block a user