# Path: reformedacademy/models.py
# class User(AbstractUser):
#     biography = models.TextField(blank=True)
#     profile_image = models.ImageField(upload_to='profile_images', blank=True)
# 
#     def __str__(self):
#         return '{} {}'.format(self.first_name, self.last_name)
# 
#     # def progress_for_course(self, course):
#     #     """Gets the progress for a course."""
#     #     return self.courseprogress_set.filter(course=course).first()


from reformedacademy.models import User
#!/usr/bin/env python
#
# Creates a default administrator account.
#
# Copyright (C) 2014 by Reformed Forum <reformedforum.org>
#
# This file is part of Reformed Academy.
#
# Reformed Academy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Reformed Academy 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Reformed Academy.  If not, see <http://www.gnu.org/licenses/>.

if User.objects.count() == 0:
    admin = User.objects.create(username='admin')
    admin.set_password('admin')
    admin.is_superuser = True

# Path: reformedacademy/models.py
# class User(AbstractUser):
#     biography = models.TextField(blank=True)
#     profile_image = models.ImageField(upload_to='profile_images', blank=True)
# 
#     def __str__(self):
#         return '{} {}'.format(self.first_name, self.last_name)
# 
#     # def progress_for_course(self, course):
#     #     """Gets the progress for a course."""
#     #     return self.courseprogress_set.filter(course=course).first()


# Path: reformedacademy/scripts/createadmin.py
from reformedacademy.models import User

#!/usr/bin/env python
#
# Creates a default administrator account.
#
# Copyright (C) 2014 by Reformed Forum <reformedforum.org>
#
# This file is part of Reformed Academy.
#
# Reformed Academy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Reformed Academy 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Reformed Academy.  If not, see <http://www.gnu.org/licenses/>.

if User.objects.count() == 0:
    admin = User.objects.create(username='admin')
    admin.set_password('admin')
    admin.is_superuser = True

    admin.is_staff = True