Coder Social home page Coder Social logo

events-backend's Issues

Creating an Event: Location Doesn't Exist

Description
If a location does not exist, the create event form does not allow for the functionality to create a new location. Instead a user must first use /app/post/location/ to create a location and then come back to the create event form.

Remove Commented Backend Code

These code should either be revitalized or killed to avoid future confusion.

TODO List:

  • Example 1
    """
    class SignUpForm(UserCreationForm):
    name = forms.CharField(max_length=30, required=False, help_text='Optional.')
    netid = forms.CharField(max_length=30, required=False, help_text='Optional.')
    org_name = forms.CharField(max_length=30, required=False, help_text='Optional.')
    org_email = forms.EmailField(max_length=254, help_text='Required. Inform a valid email address.')
    facebook = forms.CharField(max_length=30, required=False, help_text='Optional.')
    website = forms.CharField(max_length=30, required=False, help_text='Optional.')
    contact_us = forms.CharField(max_length=30, required=False, help_text='Optional.')
    class Meta:
    model = User
    fields = ('org_name', 'password1', 'password2', 'name', 'netid', 'facebook', 'website', 'contact_us')
    """
  • Example 2
    # class Org(models.Model):
    # name = models.CharField(max_length=MAX_NAME_LENGTH)
    # description = models.CharField(max_length=MAX_DESC_LENGTH)
    # website = models.CharField(max_length=MAX_WEBSITE_LENGTH)
    # photo = models.ForeignKey(
    # 'Media', on_delete=models.CASCADE, blank=True, null=True)
    # contact = models.CharField(max_length=MAX_CONTACT_LENGTH)
    # verified = models.BooleanField(default=False)
    # history = HistoricalRecords()
    # owner = models.ForeignKey(
    # 'auth.User', related_name='org', on_delete=models.CASCADE) # user
    # def __str__(self):
    # return self.name

    # class Org_Media(models.Model):
    #
    # class Meta:
    # app_label = 'app'
    #
    # #org_id = models.ForeignKey('Org', on_delete=models.CASCADE, related_name = "org_media")
    # media_id = models.ForeignKey('Media',on_delete=models.CASCADE)
    # class Profile(models.Model):
    # org_name = models.CharField(max_length=30, blank=True)
    # name = models.CharField(max_length=30, blank=True)
    # netid = models.CharField(max_length=30, blank=True)
    # facebook = models.CharField(max_length=30, blank=True)
    # website = models.CharField(max_length=30, blank=True)
    # contact_us = models.BooleanField(default = False)
    # verified = models.BooleanField(default = False)
  • Example 3
    # email = serializers.SerializerMethodField()
  • Example 4
    #path('post/org/', views.OrgFormView.as_view(), name='post_org'),
    #path('post/org/<int:pk>/', views.post_detail_org, name='post_detail_org'),
    #path('post/org/<int:pk>/edit/', views.post_edit_org, name='post_edit_org'),
    #path('post/tag/', views.TagFormView.as_view(), name='post_tag'),
    #path('post/tag/<int:pk>/', views.post_detail_tag, name='post_detail_tag'),
    #path('post/event/', views.EventFormView.as_view(), name='post_event'),
    #path('post/event/<int:pk>/', views.post_detail_event, name='post_detail_event'),
    #path('post/location/', views.LocationFormView.as_view(), name='post_location'),
    #path('post/location/<int:pk>/', views.post_detail_location, name='post_detail_location'),
    #url(r'^email/orgEmail=(?P<org_email>.*)&orgName=(?P<org_name>.*)&name=(?P<name>[a-zA-Z\s]+)&netID=(?P<net_id>[a-zA-Z0-9]+)&link=(?P<link>.*)$', views.EmailDetail.as_view(), name='Email Detail'),
  • Example 5
    # def post(self, request, format=None):
    # event = Event.objects.filter(pk=request.data["event"])[0]
    # user = Token.objects.filter(
    # pk=extractToken(request.META.get("HTTP_AUTHORIZATION"))
    # )[0].user
    # attendingSet = Attendance.objects.filter(user_id=user, event_id=event)
    # if not attendingSet.exists():
    # attendance = Attendance(user_id=user, event_id=event)
    # attendance.save()
    # event.num_attendees += 1
    # event.save()
    # return HttpResponse(status=status.HTTP_200_OK)
    # # TODO: if exists then response

List of Users: /app/users/ lists superusers

Description:

  • If the admins are admin-david, admin-arnav, the API lists:
    [{"id":1,"username":"admin-david","org":[]},{"id":2,"username":"admin-arnav","org":[]}]
    which gives everyone access to information about the admins.

Suggested Remedy

  • Not list the admins that have access to the system (just regular users)

Move secrets

Secrets are present in dev_settings.py, settings_secret.py. Should move off git

Remove Commented Frontend Code

These code should either be revitalized or killed to avoid future confusion.

TODO List:

  • Example 1
    {/* <Typography variant={"h4"} className={classes.title}>
    Account Settings
    </Typography>
    <TextField
    label="Email Address"
    className={classes.textField}
    value={this.state.email}
    onChange={e => this.setState({ email: e.target.value })}
    margin={"normal"} />
    <Typography variant={"body1"} color={"inherit"}>
    Update your email address on your
    <LinkColorless to={routes.profile.route}> profile page </LinkColorless>
  • Example 2
    {/* <Typography variant={"h4"} className={classes.title}>
    Account Settings
    </Typography>
    <TextField
    label="Email Address"
    className={classes.textField}
    value={this.state.email}
    onChange={e => this.setState({ email: e.target.value })}
    margin={"normal"} />
    <Typography variant={"body1"} color={"inherit"}>
    Update your email address on your
    <LinkColorless to={routes.profile.route}> profile page </LinkColorless>
    </Typography> */}
  • Example 3
    // import ScaleIn from 'material-ui/internal/ScaleIn';
  • Example 4
    //import VerifyCornellStatus from "./VerifyCornellStatus";
    //import VerifyOrg from "./VerifyOrg";
    //import VerifyDone from "./VerifyDone";

    //onboarding
    //describeTags: { route: "/app/describe", component: DescribeOrg }

    //verifyCornellStatus: { route: "/verifyCornellStatus/", component: VerifyCornellStatus },
    //verifyOrg: { route: "/verifyOrg", component: VerifyOrg },
    //verifyDone: { route: "/verifyDone", component: VerifyDone }
  • Example 5
    // if (tags.length > 4) {
    // this.setState({ errors: ['Only can have up to 5 tags.'] })
    // console.log("HELLO")
    // return tags
    // }

Create an Event: Shouldn't be allowed to choose a diff. organization

API - Endpoint
https://cuevents-app.herokuapp.com/app/post/event/

Description
Creating a new event allows users to choose an organization that is creating the event. In essence, this field should only list the organizations that the signed is user is the owner of, not other organizations. For example, if David owns DTI and Arnav owns CDS or Daily Sun, then when Arnav is creating an event, he should only be allowed to choose CDS or Daily Sun from the organizations. He should not be allowed to choose DTI.

Suggested Remedy
Allow a user to only select events hes the owner to on the form.

Requirements: Pillow

I had issue installing Pillow 3.2.0 as part of the install script on both my Mac & Windows laptop; no errors occur when I remove the strict versioning (and install 5.3.0 instead).

Get logged in org ID

We need some way of telling the front-end which organization is the one currently logged in, so it can make the correct API calls with its pk.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.