codeeu / coding-events

A Django app for adding EU Code Week events and showing them on a map.
http://events.codeweek.eu
MIT License
17 stars 36 forks source link

Rearrange the ambassadors page and implement the "main contact" role #425

Open mitio opened 8 years ago

mitio commented 8 years ago

What needs to be done:

michelesr commented 8 years ago

I inspected the model.

User profiles belonging to the group 'ambassadors' are the current ambassadors.

Maybe we can extend with a role field (blank for normal users) and add a proprerty that check if this field is == 'main contact'

mitio commented 8 years ago

I also think we need a new free-text role field.

However, the main ambassador's flag should be separate, I think. This would leave us to specify something else in the role field, if needed. I think that for the main ambassador, we can create a new group and use that as a "flag".

michelesr commented 8 years ago

I propose:

role = models.TextField(max_length=1000, blank=True)
main_contact = models.BooleanField(default=0)

The check would be (in pseudocode):

is_main_contact = 'ambassador' in User.groups and main_contact

Maybe the check can be avoided if we make sure that only ambassardors are able to subscribe as main contacts.

mitio commented 8 years ago

@michelesr Note that users are marked as ambassadors manually via the admin. The main contact flag will be set manually via the admin as well.

I am okay with the proposed model fields. Not sure why you'd prefer a boolean flag instead of a group for the main contact flag, but I'm okay with that as well--it was also my initial idea.

The only thing is that the role field seems a bit too long to me, we're not supposed to keep that much info there. Maybe up to 255 symbols would be fine, but I'm also okay with a limit of 1000.

michelesr commented 8 years ago

The only thing is that the role field seems a bit too long to me, we're not supposed to keep that much info there. Maybe up to 255 symbols would be fine, but I'm also okay with a limit of 1000.

Yeah, that's was only an example, limit can be set to 255 i guess.

@michelesr Note that users are marked as ambassadors manually via the admin. The main contact flag will be set manually via the admin as well.

Good. I'll start the implementation soon.