Official
@@ -18,22 +28,39 @@
{{ user.affiliation }}
{% endif %}
-
-
- {# This intentionally hides the user's place because this can be their internal profile. #}
- {# Public page hiding is done at the route level #}
- {% if scores_visible() %}
- {{ user.place }}
- place
- {% endif %}
-
-
- {% if score %}
- {{ user.score }}
+ {% if user.team_id %}
+
+
+ {# This intentionally hides the user's place because this can be their internal profile. #}
+ {# Public page hiding is done at the route level #}
+ {% if scores_visible() and user.team.place %}
+ {{ user.team.place }}
+ place
+ {% endif %}
+
+
+ {{ user.team.score }}
points
- {% endif %}
-
-
+
+
+ {% else %}
+
+
+ {# This intentionally hides the user's place because this can be their internal profile. #}
+ {# Public page hiding is done at the route level #}
+ {% if scores_visible() and user.place %}
+ {{ user.place }}
+ place
+ {% endif %}
+
+
+ {% if score %}
+ {{ user.score }}
+ points
+ {% endif %}
+
+
+ {% endif %}
{% if user.website and (user.website.startswith('http://') or user.website.startswith('https://')) %}
diff --git a/populate.py b/populate.py
index 4ea2fe7..b60d6fd 100644
--- a/populate.py
+++ b/populate.py
@@ -184,6 +184,12 @@ extensions = [
'.jav', '.pl', '.bak', '.gho', '.old', '.ori', '.tmp', '.dmg',
'.iso', '.toa', '.vcd', '.gam', '.nes', '.rom', '.sav', '.msi',
]
+companies = [
+ 'Corp',
+ 'Inc.',
+ 'Squad',
+ 'Team',
+]
def gen_sentence():
@@ -206,6 +212,10 @@ def gen_category():
return random.choice(categories)
+def gen_affiliation():
+ return (random.choice(hipsters) + " " + random.choice(companies)).title()
+
+
def gen_value():
return random.choice(range(100, 500, 50))
@@ -223,6 +233,10 @@ def random_date(start, end):
seconds=random.randint(0, int((end - start).total_seconds())))
+def random_chance():
+ return random.random() > 0.5
+
+
if __name__ == '__main__':
with app.app_context():
db = app.db
@@ -274,6 +288,10 @@ if __name__ == '__main__':
name=name,
password="password"
)
+ if random_chance():
+ team.affiliation = gen_affiliation()
+ if random_chance():
+ team.oauth_id = random.randint(1, 1000)
db.session.add(team)
count += 1
@@ -295,6 +313,10 @@ if __name__ == '__main__':
password='password'
)
user.verified = True
+ if random_chance():
+ user.affiliation = gen_affiliation()
+ if random_chance():
+ user.oauth_id = random.randint(1, 1000)
if mode == 'teams':
user.team_id = random.randint(1, TEAM_AMOUNT)
db.session.add(user)