Changeset - 1355c0ba83d3
[Not reviewed]
0 1 0
Christopher Neugebauer - 4 years ago 2017-11-29 02:26:05
chrisjrn@gmail.com
sigh
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
pinaxcon/templatetags/nbpy_tags.py
Show inline comments
...
 
@@ -61,25 +61,28 @@ def name_split(name, split_characters=None):
 
        "last" : " ".join(tokens[even_split:]),
 
    }
 

	
 
@register.simple_tag
 
def company_split(name):
 
    f =  name_split(name, 18)
 
    return f
 

	
 

	
 
@register.simple_tag(takes_context=True)
 
def special(context, user):
 
    organiser = user.groups.filter(name='Conference organisers').exists()
 
    speaker = if hasattr(user, "speaker_profile") and user.speaker_profile.presentations.count() != 0
 
    try:
 
        speaker = user.speaker_profile.presentations.count() != 0
 
    except:
 
        speaker = False
 
    volunteer = "Volunteer" in ticket_type(context)
 

	
 
    if organiser:
 
        return "Organizer"
 
    elif speaker:
 
        return "Speaker"
 
    elif volunteer:
 
        return "Staff"
 
    else:
 
        return ""
 

	
 

	
0 comments (0 inline, 0 general)