diff --git a/alembic/versions/2dcee6dfae9d_create_profile_table.py b/alembic/versions/2dcee6dfae9d_create_profile_table.py
new file mode 100644
index 0000000..38d0a10
--- /dev/null
+++ b/alembic/versions/2dcee6dfae9d_create_profile_table.py
@@ -0,0 +1,48 @@
+"""create profile table
+
+Revision ID: 2dcee6dfae9d
+Revises: 4f12d8650050
+Create Date: 2016-05-24 14:30:22.687206
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '2dcee6dfae9d'
+down_revision = '4f12d8650050'
+
+from alembic import op
+import sqlalchemy as sa
+from sqlalchemy.dialects.postgresql import ARRAY
+import datetime
+
+
+def make_timestamp():
+ now = datetime.datetime.utcnow()
+ return now.isoformat()
+
+
+def upgrade():
+ op.create_table(
+ 'profile',
+ sa.Column('id', sa.Integer, primary_key=True),
+ sa.Column('name', sa.Text, nullable=False, unique=True),
+ sa.Column('description', sa.Text, nullable=False),
+ sa.Column('access', ARRAY(sa.Text), nullable=False),
+ sa.Column('created', sa.Text, server_default=make_timestamp()),
+ )
+
+ # Add two categories
+ query = 'INSERT INTO profile (name, description, access) VALUES (\'Colaborador\', \'Colaborador geral\', \'{wikilibras}\')'
+ op.execute(query)
+ query = 'INSERT INTO profile (name, description, access) VALUES (\'Animador\', \'Animador 3D\', \'{wikilibras, corretor_sinais}\')'
+ op.execute(query)
+ query = 'INSERT INTO profile (name, description, access) VALUES (\'Especialista\', \'Especialista em LIBRAS\', \'{wikilibras, validador_sinais}\')'
+ op.execute(query)
+
+ op.add_column('user', sa.Column('profile_id', sa.Integer, sa.ForeignKey('profile.id'), server_default="1"))
+
+
+def downgrade():
+ op.drop_column('user', 'profile_id')
+ op.drop_table('profile')
+
\ No newline at end of file
diff --git a/pybossa/forms/forms.py b/pybossa/forms/forms.py
index 19f2760..c948ba0 100644
--- a/pybossa/forms/forms.py
+++ b/pybossa/forms/forms.py
@@ -279,7 +279,11 @@ class RegisterForm(Form):
[validators.Required(err_msg),
validators.EqualTo('confirm', err_msg_2)])
- confirm = PasswordField(lazy_gettext('Repeat Password'))
+ confirm = PasswordField(lazy_gettext('Repeat Password'))
+ profile = SelectField(lazy_gettext('You want to participate as'))
+
+ def set_profile_choices(self, choices):
+ self.profile.choices = choices
class UpdateProfileForm(Form):
diff --git a/pybossa/model/profile.py b/pybossa/model/profile.py
new file mode 100644
index 0000000..1051674
--- /dev/null
+++ b/pybossa/model/profile.py
@@ -0,0 +1,41 @@
+# -*- coding: utf8 -*-
+# This file is part of PyBossa.
+#
+# Copyright (C) 2015 SciFabric LTD.
+#
+# PyBossa is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# PyBossa is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with PyBossa. If not, see