anitab-org / portal

THIS PROJECT IS ARCHIVED. Systers Portal for communities.
GNU General Public License v2.0
68 stars 209 forks source link

Rename Community.community_admin to Community.admin #94

Closed ana-balica closed 9 years ago

ana-balica commented 9 years ago

At first we created our Community model with the field called community_admin to denote the Community admin, of course. So we ended up with some redundancy - community.community_admin.

Start with the renaming the field from community_admin to admin. Afterwards run migrations - python systers_portal/manage.py makemigrations and python systers_portal/manage.py migrate.

Search for all the usages across the project and make the change. The task seems trivial, but unfortunately spawns across multiple files. Be sure to run tests and flake8.

Good luck :)

bhaktipriya commented 9 years ago

I would like to fix this.

todipratik commented 9 years ago
Migrations for 'socialaccount':
  0002_auto_20150221_1704.py:
    - Alter field provider on socialaccount
    - Alter field provider on socialapp
Traceback (most recent call last):
  File "systers_portal/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/makemigrations.py", line 124, in handle
    self.write_migration_files(changes)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/makemigrations.py", line 153, in write_migration_files
    with open(writer.path, "wb") as fh:
IOError: [Errno 13] Permission denied: u'/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/migrations/0002_auto_20150221_1704.py'

@ana-balica Can you relate this makemigration error ?

ana-balica commented 9 years ago

@todipratik Well, it says you have no permissions to modify a file. Did you create a virtualenv? What OS are you on? Check what are the permissions for this file/folder and change them if necessary.

todipratik commented 9 years ago

It helped @ana-balica, thank you. If I am correct, community_admin_id also needs to replaced with admin_id ?

ana-balica commented 9 years ago

Yes.